From: John DeSoi <desoi@pgedit.com>
To: Markus Schaber <schabi@logix-tt.com>
Cc: PostGIS Users Discussion <postgis-users@postgis.refractions.net>
Cc: PostgreSQL SQL List <pgsql-sql@postgresql.org>
Subject: Re: Problem using set-returning functions
Date: Mon, 27 Mar 2006 08:32:39 -0500
Message-ID: <7DB6EE64-AB49-4DA6-B690-21A53FD6045E@pgedit.com> (raw)
In-Reply-To: <4427C15C.5070905@logix-tt.com>
References: <20060324200036.ED8E52C1503@netnation.refractions.net>
<1143278826.44250cea7eccc@web-mail1.uibk.ac.at>
<4427BFE4.8050500@logix-tt.com>
<4427C15C.5070905@logix-tt.com>
On Mar 27, 2006, at 5:41 AM, Markus Schaber wrote:
> navteq=# select foo,generate_x(bar) from test;
> ERROR: set-valued function called in context that cannot accept a set
> CONTEXT: PL/pgSQL function "generate_x" line 5 at return next
>
> However, it is fine to call other set returning functions in the same
> context:
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 for your query I think you need something like:
select foo, (select x from generate_x(bar)) from test;
John DeSoi, Ph.D.
http://pgedit.com/
Power Tools for PostgreSQL
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: pgsql-sql@postgresql.org
Cc: desoi@pgedit.com, schabi@logix-tt.com, postgis-users@postgis.refractions.net
Subject: Re: Problem using set-returning functions
In-Reply-To: <7DB6EE64-AB49-4DA6-B690-21A53FD6045E@pgedit.com>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox