On Tue, Jul 22, 2003 at 10:51:51AM -0400, Tom Lane wrote:
> Fernando Nasser <fnasser@redhat.com> writes:
> > PREPARE tststmt (integer[]) AS SELECT * from testmetadata where id IN (?);
> > PREPARE tststmt (integer, integer) AS SELECT * from testmetadata where id IN (?, ?);
> > all give parsing errors.
> I would not expect the first case to work, since it violates the plain
> meaning of IN. But Joe Conway has implemented some non-SQL syntax to
> handle that in 7.4:
>
> regression=# prepare zz(int[]) as select * from tenk1 where unique1 = ANY ($1);
> PREPARE
> regression=# execute zz(ARRAY[42,66]);
Ouch. That syntax is going to be messy to transform into an IN clause for
<7.4 backends.
-O