This project is archived and is in readonly mode.
Arrays of INET type not properly parsed into a list
-
Daniele Varrazzo
- State changed from new to invalid
Please follow the new_array_type example to see how to create a generic array type caster.
>>> cur.execute("select '{127.0.0.1,10.10.1.16}'::inet[]") >>> print cur.fetchone() ('{127.0.0.1,10.10.1.16}',) >>> cur.execute("select typarray from pg_type where typname = 'inet'") >>> print cur.fetchone() (1041,) >>> psycopg2.extensions.register_type( ... psycopg2.extensions.new_array_type( ... (1041,), 'INET[]', psycopg2.STRING)) >>> cur.execute("select '{127.0.0.1,10.10.1.16}'::inet[]") >>> print cur.fetchone() (['127.0.0.1', '10.10.1.16'],)