From james.cooper@luckydigital.com Sun Feb 2 21:45:32 2003 X-Original-To: pgsql-sql@postgresql.org Received: from localhost (postgresql.org [64.49.215.8]) by postgresql.org (Postfix) with ESMTP id B41B3475425 for ; Sun, 2 Feb 2003 16:45:32 -0500 (EST) Received: from luckydigital.com (www.luckydigital.com [203.109.157.4]) by postgresql.org (Postfix) with ESMTP id 8134A4753A1 for ; Sun, 2 Feb 2003 16:45:31 -0500 (EST) Received: from jax (203-109-198-1.akl.ihugultra.co.nz [203.109.198.1]) by luckydigital.com (8.11.6/8.10.0) with SMTP id h12LjWC14221 for ; Mon, 3 Feb 2003 10:45:32 +1300 Message-ID: <01ac01c2cb04$6af0aa20$c900a8c0@jax> From: "mail.luckydigital.com" To: Subject: 7.2 functions that return multiple result sets? Date: Mon, 3 Feb 2003 10:45:35 +1300 MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_NextPart_000_01A9_01C2CB71.61B79780" X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 6.00.2800.1106 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1106 X-Virus-Scanned: by AMaViS new-20020517 X-Archive-Number: 200302/121 X-Sequence-Number: 11519 This is a multi-part message in MIME format. ------=_NextPart_000_01A9_01C2CB71.61B79780 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Can some one please confirm( with a plpgsql function example please ) a pos= tgres "7.2" function that can return multiple rows to the client. I've gone through the docs and can't find anything to support this -it seem= s you can only have one return value or null.=20 Yes i'm aware this it is possible in 7.3 - can someone please confirm its n= ot possible in 7.2 or provide me with an example of how to go about it. Thank you. ------=_NextPart_000_01A9_01C2CB71.61B79780 Content-Type: text/html; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable
Can some one please confirm( with a plpgsq= l=20 function example please ) a postgres "7.2" function that can return multipl= e=20 rows to the client.
 
I've gone through the docs and can't find = anything=20 to support this -it seems you can only have one return value or null.=20
 
Yes i'm aware this it is possible in 7.3 -= can=20 someone please confirm its not possible in 7.2 or provide me with an exampl= e of=20 how to go about it.
 
 
Thank you.
------=_NextPart_000_01A9_01C2CB71.61B79780-- From chad@weblinkservices.com Thu Feb 6 19:31:29 2003 X-Original-To: pgsql-sql@postgresql.org Received: from localhost (postgresql.org [64.49.215.8]) by postgresql.org (Postfix) with ESMTP id C3F9C475AAC for ; Thu, 6 Feb 2003 14:31:29 -0500 (EST) Received: from utahisp.com (pop3.utahisp.com [66.239.12.3]) by postgresql.org (Postfix) with ESMTP id 32B07475A45 for ; Thu, 6 Feb 2003 14:31:25 -0500 (EST) Received: from chad [63.230.8.76] by utahisp.com (SMTPD32-7.13) id A7CC3677028A; Thu, 06 Feb 2003 12:30:20 -0700 Message-ID: <013801c2ce15$ef0ac250$32021aac@chad> From: "Chad Thompson" To: "mail.luckydigital.com" , References: <01ac01c2cb04$6af0aa20$c900a8c0@jax> Subject: Re: 7.2 functions that return multiple result sets? Date: Thu, 6 Feb 2003 12:28:30 -0700 MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_NextPart_000_0135_01C2CDDB.41D78350" X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 6.00.2720.3000 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2600.0000 X-Declude-Sender: chad@weblinkservices.com [63.230.8.76] X-Note: This E-mail was scanned by Declude JunkMail (www.declude.com) for spam. X-Virus-Scanned: by AMaViS new-20020517 X-Archive-Number: 200302/131 X-Sequence-Number: 11529 This is a multi-part message in MIME format. ------=_NextPart_000_0135_01C2CDDB.41D78350 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Found this using google from http://archives.postgresql.org/pgsql-sql/2002-01/msg00312.php Depending on what you're doing (and if you're willing to work with the 7.2rcs or wait for it), 7.2 allows you to define functions that return cursors that you can then fetch from within the transaction you called the function in, so you should be able to do a sequence like: begin; select * from func(param); -- get back name of cursor, say "" -- fetch 10 from ""; fetch 10 from ""; close ""; commit; Seems 7.2 is limited to cursors, where 7.3 will do recordsets (and upgradin= g is SO easy) HTH Chad ----- Original Message -----=20 From: mail.luckydigital.com=20 To: pgsql-sql@postgresql.org=20 Sent: Sunday, February 02, 2003 2:45 PM Subject: [SQL] 7.2 functions that return multiple result sets? Can some one please confirm( with a plpgsql function example please ) a p= ostgres "7.2" function that can return multiple rows to the client. I've gone through the docs and can't find anything to support this -it se= ems you can only have one return value or null.=20 Yes i'm aware this it is possible in 7.3 - can someone please confirm its= not possible in 7.2 or provide me with an example of how to go about it. Thank you. ------=_NextPart_000_0135_01C2CDDB.41D78350 Content-Type: text/html; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable
Found this using google
from http= ://archives.postgresql.org/pgsql-sql/2002-01/msg00312.php
 
Depending on what you're doing (and if you're willing to work with=20 the
7.2rcs or wait for it), 7.2 allows you to define functions that=20 return
cursors that you can then fetch from within the transaction you c= alled=20 the
function in, so you should be able to do a sequence=20 like:

begin;
select * from func(param);
-- get back name of cu= rsor,=20 say "<unnamed cursor 1>" --
fetch 10 from "<unnamed cursor=20 1>";
fetch 10 from "<unnamed cursor 1>";
close "<unnamed= =20 cursor 1>";
commit;

Seems 7.2 is l= imited to=20 cursors, where 7.3 will do recordsets (and upgrading is SO easy)
 
HTH
Chad
----- Original Message -----
Fro= m:=20 mail.luckydigital.com <= /DIV>
To: pgsql-sql@postgresql.org
Sent: Sunday, February 02, 2003 2:= 45=20 PM
Subject: [SQL] 7.2 functions that = return=20 multiple result sets?

Can some one please confirm( with a plpg= sql=20 function example please ) a postgres "7.2" function that can return multi= ple=20 rows to the client.
 
I've gone through the docs and can't fin= d=20 anything to support this -it seems you can only have one return value or = null.=20
 
Yes i'm aware this it is possible in 7.3= - can=20 someone please confirm its not possible in 7.2 or provide me with an exam= ple=20 of how to go about it.
 
 
Thank you.
------=_NextPart_000_0135_01C2CDDB.41D78350-- From barwick@gmx.net Thu Feb 6 23:09:34 2003 X-Original-To: pgsql-sql@postgresql.org Received: from localhost (postgresql.org [64.49.215.8]) by postgresql.org (Postfix) with ESMTP id 14CBB47607B for ; Thu, 6 Feb 2003 18:09:34 -0500 (EST) Received: from post.webmailer.de (natsmtp01.webmailer.de [192.67.198.81]) by postgresql.org (Postfix) with ESMTP id 3D4CA476417 for ; Thu, 6 Feb 2003 17:54:24 -0500 (EST) Received: from ianb.local (pD95177A3.dip.t-dialin.net [217.81.119.163]) by post.webmailer.de (8.9.3/8.8.7) with ESMTP id XAA15937; Thu, 6 Feb 2003 23:54:17 +0100 (MET) Content-Type: text/plain; charset="iso-8859-1" From: Ian Barwick To: "mail.luckydigital.com" , Subject: Re: 7.2 functions that return multiple result sets? Date: Thu, 6 Feb 2003 23:53:55 +0100 X-Mailer: KMail [version 1.4] References: <01ac01c2cb04$6af0aa20$c900a8c0@jax> In-Reply-To: <01ac01c2cb04$6af0aa20$c900a8c0@jax> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Message-Id: <200302062353.55824.barwick@gmx.net> X-Virus-Scanned: by AMaViS new-20020517 X-Archive-Number: 200302/134 X-Sequence-Number: 11532 On Sunday 02 February 2003 22:45, mail.luckydigital.com wrote: > Can some one please confirm( with a plpgsql function example please ) a > postgres "7.2" function that can return multiple rows to the client. > > I've gone through the docs and can't find anything to support this -it > seems you can only have one return value or null. > > Yes i'm aware this it is possible in 7.3 - can someone please confirm its > not possible in 7.2 or provide me with an example of how to go about it. IIRC this is a new feature in 7.3, see: http://www.postgresql.org/docs/view.php?version=3D7.3&idoc=3D0&file=3Drelea= se.html "Allow functions to return multiple rows (table functions) (Joe)" Ian Barwick barwick@gmx.net