Received: from localhost.localdomain (postgresql.org [64.49.215.8]) by localhost (Postfix) with ESMTP id 0882B476AB9 for ; Fri, 5 Jul 2002 13:24:10 -0400 (EDT) Mailbox-Line: From sszabo@megazone23.bigpanda.com Fri Jul 5 13:24:10 2002 Received: from megazone.bigpanda.com (megazone.bigpanda.com [63.150.15.178]) by postgresql.org (Postfix) with ESMTP id 24D90476B11 for ; Fri, 5 Jul 2002 12:10:10 -0400 (EDT) Received: by megazone.bigpanda.com (Postfix, from userid 1001) id 377ECD5F7; Fri, 5 Jul 2002 09:10:11 -0700 (PDT) Received: from localhost (localhost [127.0.0.1]) by megazone.bigpanda.com (Postfix) with ESMTP id 2B3E35C03; Fri, 5 Jul 2002 09:10:11 -0700 (PDT) Date: Fri, 5 Jul 2002 09:10:11 -0700 (PDT) From: Stephan Szabo To: teknokrat Cc: Subject: Re: How do i return a dataset from a stored procedure In-Reply-To: <1cbae208.0207050032.4e052f07@posting.google.com> Message-ID: <20020705090743.X27508-100000@megazone23.bigpanda.com> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-Spam-Status: No, hits=-3.0 required=5.0 tests=IN_REP_TO,X_NOT_PRESENT,TO_LOCALPART_EQ_REAL,NO_MX_FOR_FROM version=2.30 X-Spam-Level: X-Archive-Number: 200207/69 X-Sequence-Number: 8448 On 5 Jul 2002, teknokrat wrote: > I can't figure out how to return a group of rows from a function > written in plpgsql (or plsql for that matter). The only way i have > seen it done is with a setof table return value in sql. But since the > query was a single select anyway i don't see the point of this. Is > there a way of creating a temporary table in a procedure and using it > as the output? In 7.2 you can return open cursors from plpgsql functions. You can make temp tables in a function, but you have to be careful to make sure that you don't conflict (what happens if the user calls your function twice)