Thread: returning Setof Record

returning Setof Record

From
glenn
Date:
hi
Q1 - is it at least notionally possible to declare a function to return
'setof record' - i.e. a generic composite type as opposed to a composite
type based on an exisiting table?

Q2 - Supposing it is possible When I try the above I get the error:
"A column definition list is required for functions returning RECORD"
So now I'm wondering how to define a "column defintition list" ?

Any help muchly appreciated.
Glenn


Re: returning Setof Record

From
Avi Schwartz
Date:
Glenn,

Try this for help.

http://techdocs.postgresql.org/guides/SetReturningFunctions

You will have to specify the structure of the record when you select
from the function.

Avi

On Monday, Sep 1, 2003, at 00:23 America/Chicago, glenn wrote:

> hi
> Q1 - is it at least notionally possible to declare a function to return
> 'setof record' - i.e. a generic composite type as opposed to a
> composite
> type based on an exisiting table?
>
> Q2 - Supposing it is possible When I try the above I get the error:
> "A column definition list is required for functions returning RECORD"
> So now I'm wondering how to define a "column defintition list" ?