Re: Functions returning sets

From: Don Baccus <dhogaza(at)pacifier(dot)com>
To: Stephan Szabo <sszabo(at)megazone23(dot)bigpanda(dot)com>, Hackers List <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Functions returning sets
Date: 2001-05-19 23:08:37
Message-ID: 3.0.1.32.20010519160837.01634c40@mail.pacifier.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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(at)pacifier(dot)com>
Nature photos, on-line guides, Pacific Northwest
Rare Bird Alert Service and other goodies at
http://donb.photo.net.

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Joe Conway 2001-05-19 23:38:16 Re: Re: Functions returning sets
Previous Message Mike Mascari 2001-05-19 22:41:45 RE: Re: Functions returning sets