Re: Set-returning function syntax - Mailing list pgsql-hackers

From Joe Conway
Subject Re: Set-returning function syntax
Date
Msg-id 3CE6F82E.4070509@joeconway.com
Whole thread Raw
In response to Set-returning function syntax  ("Joel Burton" <joel@joelburton.com>)
List pgsql-hackers
Tatsuo Ishii wrote:
> Does your SRF function allow to return a setof composite data type
> using C function? If so, how can I write such that C function? I

Just to follow-up, here's a quick look at what works and what doesn't, 
at least using my test script.

SELECT * FROM myfunc();
Language 
RetSet 
RetType 
Status
--------------- ------- ------- ---------------------
C t    b    OK
C t    c    Not tested
C f    b    OK
C f    c    Not tested
SQL t    b    OK
SQL t    c    OK
SQL f    b    OK
SQL f    c    OK
PL/pgSQL 
t 
b 
No retset support
PL/pgSQL 
t 
c 
No retset support
PL/pgSQL 
f 
b 
OK
PL/pgSQL 
f 
c 
OK
-----------------------------------------------------
RetSet: t = function declared to return setof something
RetType: b = base type; c = composite type

Same cases work when a view is defined as SELECT * FROM myfunc().

Joe



pgsql-hackers by date:

Previous
From: Joe Conway
Date:
Subject: Re: Set-returning function syntax
Next
From: Tatsuo Ishii
Date:
Subject: Re: Set-returning function syntax