Re: Problem using set-returning functions

From: Stephan Szabo <sszabo(at)megazone(dot)bigpanda(dot)com>
To: Markus Schaber <schabi(at)logix-tt(dot)com>
Cc: John DeSoi <desoi(at)pgedit(dot)com>, PostGIS Users Discussion <postgis-users(at)postgis(dot)refractions(dot)net>, PostgreSQL SQL List <pgsql-sql(at)postgresql(dot)org>
Subject: Re: Problem using set-returning functions
Date: 2006-03-27 15:06:09
Message-ID: 20060327070103.U96317@megazone.bigpanda.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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;

In response to

Responses

Browse pgsql-sql by date

  From Date Subject
Next Message PFC 2006-03-27 15:12:49 Re: Expressing a result set as an array (and vice versa)?
Previous Message Jim C. Nasby 2006-03-27 15:05:34 Re: unique names in variables and columns in plsql functions