X-Original-To: pgsql-sql@postgresql.org Received: from localhost (postgresql.org [64.49.215.8]) by postgresql.org (Postfix) with ESMTP id 77753474E53 for ; Mon, 17 Feb 2003 15:18:20 -0500 (EST) Received: from megazone.bigpanda.com (megazone.bigpanda.com [63.150.15.178]) by postgresql.org (Postfix) with ESMTP id 08179474E42 for ; Mon, 17 Feb 2003 15:18:20 -0500 (EST) Received: by megazone.bigpanda.com (Postfix, from userid 1001) id 8B682D5F7; Mon, 17 Feb 2003 12:18:20 -0800 (PST) Received: from localhost (localhost [127.0.0.1]) by megazone.bigpanda.com (Postfix) with ESMTP id 80EA95C03; Mon, 17 Feb 2003 12:18:20 -0800 (PST) Date: Mon, 17 Feb 2003 12:18:20 -0800 (PST) From: Stephan Szabo To: Mintoo Lall Cc: Subject: Re: Returning multiple rows from plpgsql function In-Reply-To: <20030217200713.84465.qmail@web14809.mail.yahoo.com> Message-ID: <20030217121738.F9891-100000@megazone23.bigpanda.com> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-Virus-Scanned: by AMaViS new-20020517 X-Archive-Number: 200302/385 X-Sequence-Number: 11783 On Mon, 17 Feb 2003, Mintoo Lall wrote: > How can I return multiple rows from a plpqsql function. I wanted to > write a function which gives me the result of the final select query > from a bunch of nested select queries. What return type should use? > The return type %ROWTYPE only returns a single row. In SQL function I > can do this by stating that the function returns a setof record but it > doesnt work in plpgsql function. You might want to look at the Set Returning Functions document at techdocs.postgresql.org.