Re: the IN clause saga

Поиск
Список
Период
Сортировка
От Fernando Nasser
Тема Re: the IN clause saga
Дата
Msg-id 3F1D5536.6020700@redhat.com
обсуждение исходный текст
Ответ на the IN clause saga  (Oliver Jowett <oliver@opencloud.com>)
Список pgsql-jdbc
Oliver Jowett wrote:
> 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.
>

Remember we will already have to know that we are handling the <in
values list> clause (i.e. it is a " IN (?)'), so we can very well
special case the expansion of the array.

But it will be much better on 7.4 and V3, I agree.

--
Fernando Nasser
Red Hat Canada Ltd.                     E-Mail:  fnasser@redhat.com
2323 Yonge Street, Suite #300
Toronto, Ontario   M4P 2C9


В списке pgsql-jdbc по дате отправления:

Предыдущее
От: Felipe Schnack
Дата:
Сообщение: Re: the IN clause saga
Следующее
От: Fernando Nasser
Дата:
Сообщение: Re: the IN clause saga