Re: Functions returning sets

Поиск
Список
Период
Сортировка
От Don Baccus
Тема Re: Functions returning sets
Дата
Msg-id 3.0.1.32.20010519160837.01634c40@mail.pacifier.com
обсуждение исходный текст
Ответ на Functions returning sets  (mlw <markw@mohawksoft.com>)
Ответы Re: Functions returning sets  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-hackers
At 02:08 PM 5/19/01 -0700, Stephan Szabo wrote:
>
>(Machine couldn't find mx record for mohawksoft, replying only
>to list)
>
>On Sat, 19 May 2001, mlw wrote:
>
>> Sorry to gripe here. Don't get me wrong, I think Postgres is amazing, and I
>> think all you guys do an amazing job. 
>> 
>> Is it just me, or do others agree, functions returning sets need to be able to
>> be used in a select where equal clause.
>>
>> select * from table where field = funct_set('bla bla');
>
>I think what we should probably do is make IN better...

IN is the right operator.  "field = [set of rows]" isn't SQL92 and doesn't
really make sense.   It's the equivalent of:

select * from table where field = (select some_column from some_other_table)

If the subselect returns a single row it will work, if it returns multiple
rows you need to use IN.  That's just how SQL92 is defined.

I'd assume that a function returning a single column and single row will
work just as the subselect does, but there's no reason expect it to work
if more than one row is returned.

What's so hard about writing "IN" rather than "=" ???



- Don Baccus, Portland OR <dhogaza@pacifier.com> Nature photos, on-line guides, Pacific Northwest Rare Bird Alert
Serviceand other goodies at http://donb.photo.net.
 


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

Предыдущее
От: Mike Mascari
Дата:
Сообщение: RE: Re: Functions returning sets
Следующее
От: "Joe Conway"
Дата:
Сообщение: Re: Re: Functions returning sets