Re: Problem using set-returning functions - Mailing list pgsql-sql

From Stephan Szabo
Subject Re: Problem using set-returning functions
Date
Msg-id 20060327070103.U96317@megazone.bigpanda.com
Whole thread Raw
In response to Re: Problem using set-returning functions  (Markus Schaber <schabi@logix-tt.com>)
Responses Re: Problem using set-returning functions
List pgsql-sql
On Mon, 27 Mar 2006, Markus Schaber wrote:

> Hi, John,
>
> John DeSoi wrote:
>
> > With SRFs, you need to specify what you want to select. In other  words
> > if you are calling generate_x(bar) you need "select * from
> > generate_x(bar)" -- "select generate_x(bar)" will not work.
>
> So, then, why does it work with generate_series() and dump()?

It's an implementation detail. Some languages handle SRFs in a way that
can be handled in the select list (SQL and C I think) and others do not
(plpgsql). The latter will likely change at some point, although there are
some confusing issues with SRFs in the select list as well, see the
difference in behavior between:

select generate_series(1,10), generate_series(1,5);vs
select * from generate_series(1,10) g1, generate_series(1,5) g2;


pgsql-sql by date:

Previous
From: "Jim C. Nasby"
Date:
Subject: Re: unique names in variables and columns in plsql functions
Next
From: PFC
Date:
Subject: Re: Expressing a result set as an array (and vice versa)?