I'm using Postgres 9.2, Python 2.7.3, psycopg2 2.5.1.
I have a table, with one of the fields declared as 'some_field int[] NOT NULL' and I need to insert some data, so I'm doing something like this:
cursor.execute('INSERT INTO some_table (some_field) VALUES (%s)', ([1, 2, 3], ))
but unexpectedly getting an error 'DataError: missing "]" in array dimensions', because the result query becames
INSERT INTO some_table (some_field) VALUES ('[1, 2, 3]')
instead of
INSERT INTO some_table (some_field) VALUES (ARRAY[1, 2, 3])
or
INSERT INTO some_table (some_field) VALUES ('{1, 2, 3}')
Am I missing something or it is a psycopg2 error?