X-Original-To: pgsql-sql-postgresql.org@localhost.postgresql.org Received: from localhost (av.hub.org [200.46.204.144]) by postgresql.org (Postfix) with ESMTP id D8E2D9DCBC8 for ; Mon, 27 Mar 2006 11:06:19 -0400 (AST) Received: from postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 85295-02 for ; Mon, 27 Mar 2006 11:06:13 -0400 (AST) X-Greylist: from auto-whitelisted by SQLgrey- Received: from megazone.bigpanda.com (megazone.bigpanda.com [64.147.171.210]) by postgresql.org (Postfix) with ESMTP id EC06A9DC831 for ; Mon, 27 Mar 2006 11:06:06 -0400 (AST) Received: by megazone.bigpanda.com (Postfix, from userid 1001) id 046C5350E6; Mon, 27 Mar 2006 07:06:10 -0800 (PST) Received: from localhost (localhost [127.0.0.1]) by megazone.bigpanda.com (Postfix) with ESMTP id 01A6C350E5; Mon, 27 Mar 2006 07:06:09 -0800 (PST) Date: Mon, 27 Mar 2006 07:06:09 -0800 (PST) From: Stephan Szabo To: Markus Schaber Cc: John DeSoi , PostGIS Users Discussion , PostgreSQL SQL List Subject: Re: Problem using set-returning functions In-Reply-To: <4427F003.2070705@logix-tt.com> Message-ID: <20060327070103.U96317@megazone.bigpanda.com> References: <20060324200036.ED8E52C1503@netnation.refractions.net> <1143278826.44250cea7eccc@web-mail1.uibk.ac.at> <4427BFE4.8050500@logix-tt.com> <4427C15C.5070905@logix-tt.com> <7DB6EE64-AB49-4DA6-B690-21A53FD6045E@pgedit.com> <4427F003.2070705@logix-tt.com> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, score=0.14 required=5 tests=[AWL=0.140] X-Spam-Score: 0.14 X-Spam-Level: X-Archive-Number: 200603/429 X-Sequence-Number: 24775 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;