X-Original-To: pgsql-sql-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.2]) by svr1.postgresql.org (Postfix) with ESMTP id 55147D1E926 for ; Sun, 29 Feb 2004 12:37:54 +0000 (GMT) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (neptune.hub.org [200.46.204.2]) (amavisd-new, port 10024) with ESMTP id 88940-02 for ; Sun, 29 Feb 2004 08:37:43 -0400 (AST) Received: from out1.smtp.messagingengine.com (out1.smtp.messagingengine.com [66.111.4.25]) by svr1.postgresql.org (Postfix) with ESMTP id 9C02DD1E923 for ; Sun, 29 Feb 2004 08:37:39 -0400 (AST) X-Sasl-enc: UzWj5gT9fVD4WsFWSOdcNQ 1078058184 Received: from isd.canberra.edu.au (unknown [203.37.117.70]) by www.fastmail.fm (Postfix) with ESMTP id 0482067AF94 for ; Sun, 29 Feb 2004 07:36:23 -0500 (EST) Message-ID: <4041DCBF.203@isd.canberra.edu.au> Date: Sun, 29 Feb 2004 23:36:15 +1100 From: Terence Kearns Reply-To: terence.kearns@canberra.edu.au Organization: University Of Canberra User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.5) Gecko/20031007 X-Accept-Language: en-us, en MIME-Version: 1.0 To: pgsql-sql@postgresql.org Subject: returning a recordset from PLpg/SQL Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200402/387 X-Sequence-Number: 17077 Looking at the datatypes you can RETURN, it doesn't seem that there is a way to return a recordset I tried RETURNS SETOF RECORD but that doesn't work I even tried RETURNS SETOF fooTable%ROWTYPE What I would like to do is not that simple, I need to be able to build/declare a record definition with an arbitary list of columns and then return a set of that record which has it's values populated by queries and calculations inside the procedure. returning an array is not a solution because I need to name all the columns and they will have different data types.