pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: Jan Wieck <janwieck@Yahoo.com>
Cc: hlefebvre <hlefebvre@lexbase.net>
Cc: pgsql-sql@postgresql.org
Subject: Re: Using SETOF in plpgsql function
Date: Wed, 23 Aug 2000 10:24:35 -0400
Message-ID: <27932.967040675@sss.pgh.pa.us> (raw)
In-Reply-To: <200008231427.JAA00959@jupiter.greatbridge.com>
References: <200008231427.JAA00959@jupiter.greatbridge.com>

Jan Wieck <janwieck@Yahoo.com> writes:
> hlefebvre wrote:
>> I'd like to return a set of integer in an pl/pgsql function. How can I
>> do that ?

>     You  can't. Not with PL/pgSQL nor with any other PL or C. The
>     problem is nested deeper and requires the  planned  querytree
>     redesign to get solved.

Not really.  Coincidentally enough, I am just in the middle of removing
execQual.c's hard-wired assumption that only SQL-language functions
can return sets.  (This is a side effect of fixing the function manager
so that SQL functions can be called in all contexts, eg used as index
functions.)  If you want to fix plpgsql so that it retains state and
can produce multiple elements of a set over repeated calls, the same
way that SQL functions do, then it could be done today.

We may well want to rip out that whole approach to set functions later
when we redo querytrees, but the real limitation so far has been bogus
assumptions in the function-call API, not querytrees.

			regards, tom lane



view thread (8+ messages)  latest in thread

Message-ID: <27932.967040675@sss.pgh.pa.us>
Permalink:  ../27932.967040675@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/27932.967040675@sss.pgh.pa.us

 · 

reply

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 from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-sql@postgresql.org
  Cc: tgl@sss.pgh.pa.us, janwieck@Yahoo.com, hlefebvre@lexbase.net
  Subject: Re: Using SETOF in plpgsql function
  In-Reply-To: <27932.967040675@sss.pgh.pa.us>
  References: <200008231427.JAA00959@jupiter.greatbridge.com> <27932.967040675@sss.pgh.pa.us>

* 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