From: Tom Lane <tgl@sss.pgh.pa.us>
To: mig@utdt.edu
Cc: pgsql-sql@postgresql.org
Subject: Re: Re: Returning sets from functions?
Date: Sun, 23 Apr 2000 17:32:01 -0400
Message-ID: <14698.956525521@sss.pgh.pa.us> (raw)
In-Reply-To: <200004231502.MAA05163@ant.utdt>
References: <200004231502.MAA05163@ant.utdt>
mig@utdt.edu writes:
> Consider
> create function followers(text) returns setof text as
> 'select id from ids where id > $1 '
> language 'sql';
> The function seems to work OK:
> select followers('h');
> does return all indexes after the index 'h'.
> On the other hand,
> select * from ids where id in (select followers('h'));
> produces the message
> ERROR: An operand to the '=' operator returns a set of text,
> but '=' takes single values, not sets.
Seems to work in 7.0, which actually surprises me quite a bit ;-).
Functions returning sets are only very shakily implemented right now.
We've cured a few bugs since 6.5, but it's going to be difficult
to make much further progress with them until the fabled querytree
redesign happens (which will also bring outer joins and some other
good stuff). Current plans are to tackle that for 7.2, which might
be out by the end of the year or so.
> Sorry, I forgot part of my question in the previous message:
> How do you return a "setof" value from a PG/Tcl procedure?
Right now I think you can't ...
regards, tom lane
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, mig@utdt.edu
Subject: Re: Returning sets from functions?
In-Reply-To: <14698.956525521@sss.pgh.pa.us>
References: <200004231502.MAA05163@ant.utdt> <14698.956525521@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