On Fri, Nov 15, 2013 at 12:34 PM, Luca Ferroni <luca@befair.it> wrote:
> Prepared statements work with query like:
>
> prepare psyco_1 as SELECT * FROM "prova" WHERE "name" = $1
>
> but they raise ProgrammingError (syntaxerror SQL) with the operator IN
>
> prepare psyco_1 as SELECT * FROM "prova" WHERE "name" IN $1
I suspect the () of IN are a syntactic feature and cannot be passed as
a parameter.
Do you want to try to replace the query with "... WHERE name =
any($1)" and pass the parameter as a python list instead of a tuple?
(see also http://initd.org/psycopg/docs/usage.html#adapt-list)
-- Daniele