Hmm, I was trying to remember why lists and tuples were different and found this in the docs:
Python lists are converted into PostgreSQL
ARRAYs:
>>> cur.mogrify("SELECT %s;", ([10, 20, 30], ))
'SELECT ARRAY[10, 20, 30];'
Python tuples are converted in a syntax suitable for the SQL IN operator and to represent a composite type:
>>> cur.mogrify("SELECT %s IN %s;", (10, (10, 20, 30)))
'SELECT 10 IN (10, 20, 30);'
Just remember that. :)
2011/6/24 Sukhbir Singh
<singheinstein@gmail.com> Hi,
> Actually, a list or a tuple will work just fine.
Indeed, it does work. I somehow didn't try the most obvious solution
to this, focusing on unpacking all the time :-)
Thank you.
--