Re: the IN clause saga - Mailing list pgsql-jdbc

From Oliver Jowett
Subject Re: the IN clause saga
Date
Msg-id 20030722151132.GP11354@opencloud.com
Whole thread Raw
In response to Re: the IN clause saga  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-jdbc
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

pgsql-jdbc by date:

Previous
From: Felipe Schnack
Date:
Subject: Re: patch: tiny patch to correct stringbuffer size estimate
Next
From: Felipe Schnack
Date:
Subject: Re: the IN clause saga