Received: from davinci.ethosmedia.com (davinci.ethosmedia.com [209.10.40.250]) by mail.postgresql.org (8.11.1/8.11.1) with ESMTP id f1NFYkx50943 for ; Fri, 23 Feb 2001 10:34:46 -0500 (EST) (envelope-from josh@agliodbs.com) Received: from [209.10.40.250] (account ) by davinci.ethosmedia.com (CommuniGate Pro WebUser 3.3) with HTTP id 1194176; Fri, 23 Feb 2001 07:34:42 -0800 From: "Josh Berkus" Subject: Re: Can a function return a record set? To: "John Taves" Cc: pgsql-sql@postgresql.org X-Mailer: CommuniGate Pro Web Mailer v.3.3 Date: Fri, 23 Feb 2001 07:34:42 -0800 Message-ID: In-Reply-To: <3a8f7b37_1@news.nwlink.com> MIME-Version: 1.0 Content-Type: text/plain; charset="ISO-8859-1" Content-Transfer-Encoding: 8bit X-Archive-Number: 200102/356 X-Sequence-Number: 1552 Mr. Taves, > Am I correct in concluding that I can't return a record > set from a function? > > For example, in MS SQL I would do: > > create procedure foo as > select * from yada > > I expected to be able to do the following in postgresql. > > create function foo (integer) returns (integer) as ' > begin > select * from yada; > end; ' > language 'plpgsql'; > > I am concluding that I can't. You are correct. Stored procedures that return rowsets are in the "wish list" for 7.2 or 8.0 ... but not in the current development version. Please browse the archives (about 1-2 months ago) for my suggested workaround for the time being. -Josh Berkus ______AGLIO DATABASE SOLUTIONS___________________________ Josh Berkus Complete information technology josh@agliodbs.com and data management solutions (415) 565-7293 for law firms, small businesses fax 621-2533 and non-profit organizations. San Francisco