Skip site navigation (1) Skip section navigation (2)

returning a recordset from PLpg/SQL

From: Terence Kearns <terencek(at)isd(dot)canberra(dot)edu(dot)au>
To: pgsql-sql(at)postgresql(dot)org
Subject: returning a recordset from PLpg/SQL
Date: 2004-02-29 12:36:15
Message-ID: 4041DCBF.203@isd.canberra.edu.au (view raw or flat)
Thread:
Lists: pgsql-sql
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.



Responses

pgsql-sql by date

Next:From: Tom LaneDate: 2004-02-29 15:11:48
Subject: Re: returning a recordset from PLpg/SQL
Previous:From: Bruce MomjianDate: 2004-02-29 02:44:58
Subject: Re: Enterprice support in PostgreSQL

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group