Received: from narrowsearch.com (IDENT:root@[209.209.0.246]) by hub.org (8.9.1/8.9.1) with ESMTP id TAA27792 for ; Sat, 5 Dec 1998 19:36:02 -0500 (EST) (envelope-from ed@edwardcox.com) Received: from JEFFERSON (1Cust96.tnt4.sfo3.da.uu.net [153.37.12.96]) by narrowsearch.com (8.8.7/8.8.7) with SMTP id RAA22355 for ; Sat, 5 Dec 1998 17:38:59 -0800 Message-ID: <000001be20b0$028d4c20$600c2599@JEFFERSON> From: "Ed Cox" To: Subject: How can I return multiple rows from a FUNCTION? Date: Sat, 5 Dec 1998 16:32:56 -0800 MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_NextPart_000_0004_01BE206C.E9DEC480" X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 4.72.2106.4 X-MimeOLE: Produced By Microsoft MimeOLE V4.72.2106.4 This is a multi-part message in MIME format. ------=_NextPart_000_0004_01BE206C.E9DEC480 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Is it possible to have a FUNCTION in Postgres that returns multiple = rows? Something like: CREATE FUNCTION foo() RETURNS ??? AS 'SELECT count(*) FROM bar' LANGUAGE 'sql'; If not, can you suggest a way to encapsulate this functionality? I'd = like to keep all SQL code out of my GSP code. Thanks very much, Ed Cox ------=_NextPart_000_0004_01BE206C.E9DEC480 Content-Type: text/html; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable
Is it possible to have a FUNCTION in = Postgres=20 that returns multiple rows?  Something like:
 
CREATE FUNCTION foo()
RETURNS ???
AS 'SELECT count(*) FROM bar'
LANGUAGE 'sql';
 
If not, can you suggest a way to encapsulate this=20 functionality?  I'd like to keep all SQL code out of my GSP=20 code.
 
Thanks very much,
Ed Cox
------=_NextPart_000_0004_01BE206C.E9DEC480--