Re: set returning function

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Dennis Bjorklund <db(at)zigo(dot)dhs(dot)org>
Cc: pgsql-bugs(at)postgresql(dot)org, airbaggins(at)yahoo(dot)co(dot)uk
Subject: Re: set returning function
Date: 2005-05-09 17:02:22
Message-ID: 29320.1115658142@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

Dennis Bjorklund <db(at)zigo(dot)dhs(dot)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

In response to

Browse pgsql-bugs by date

  From Date Subject
Next Message Tom Lane 2005-05-09 21:01:34 Re: BUG #1655: trapping errors doesn't work
Previous Message Dennis Bjorklund 2005-05-09 16:58:39 Re: set returning function