Re: set returning function - Mailing list pgsql-bugs

From Tom Lane
Subject Re: set returning function
Date
Msg-id 29320.1115658142@sss.pgh.pa.us
Whole thread Raw
In response to Re: set returning function  (Dennis Bjorklund <db@zigo.dhs.org>)
List pgsql-bugs
Dennis Bjorklund <db@zigo.dhs.org> writes:
> Is
>    SELECT 42, srf();
> the same as
>    SELECT 42, * FROM srf();
> ?

No.

> In my view the first version is an error. It's not like you can put a
> normal table in the select list, so why can we put a set returning
> function there? Ie, is it really a feature?

To some extent it's a hangover from PostQUEL ... but there are things
you can do with it that you can't currently do with SRFs in FROM.
See for instance the "listchildren" example in the manual:
http://www.postgresql.org/docs/8.0/static/xfunc-sql.html#AEN29503

            regards, tom lane

pgsql-bugs by date:

Previous
From: Dennis Bjorklund
Date:
Subject: Re: set returning function
Next
From: "Emanuel Brokmann"
Date:
Subject: BUG #1655: trapping errors doesn't work