Re: Set generating functions and subqueries - Mailing list pgsql-sql

From Tom Lane
Subject Re: Set generating functions and subqueries
Date
Msg-id 7169.1142261859@sss.pgh.pa.us
Whole thread Raw
In response to Re: Set generating functions and subqueries  (Markus Schaber <schabi@logix-tt.com>)
List pgsql-sql
Markus Schaber <schabi@logix-tt.com> writes:
> Tom Lane wrote:
>> The fact that the other form is even allowed is more of a holdover from
>> PostQUEL than something we have consciously decided is a good idea.
>> (IMHO it's actually a fairly *bad* idea, because it does not work nicely
>> when there's more than one SRF in the same targetlist.)  It'll probably
>> get phased out someday, if we can find a way to replace the
>> functionality.  I seem to recall speculating that SQL2003's LATERAL
>> tables might do the job.

> AFAICS, it can be replaced with JOINs:

Not really; the case where joins don't help is where you want to
generate the SRF's output for each of the values appearing in a table.
There's an example in "SQL Functions Returning Sets" in the manual:
http://www.postgresql.org/docs/8.1/static/xfunc-sql.html#AEN31646
        regards, tom lane


pgsql-sql by date:

Previous
From: Alvaro Herrera
Date:
Subject: Re: Permission to Select
Next
From: Rod Taylor
Date:
Subject: Re: Permission to Select