Re: the IN clause saga

Поиск
Список
Период
Сортировка
Искать
От
Fernando Nasser
Тема
Re: the IN clause saga
Дата
Msg-id
3F1D5536.6020700@redhat.com
Список
Дерево обсуждения
Re: the IN clause saga Darin Ohashi <DOhashi@maplesoft.com>
Oliver Jowett wrote:
> On Tue, Jul 22, 2003 at 10:51:51AM -0400, Tom Lane wrote:
> 
> 
>>Fernando Nasser  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  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
FAQ