Re: Proposal: TABLE functions - Mailing list pgsql-hackers

From Jeremy Drake
Subject Re: Proposal: TABLE functions
Date
Msg-id Pine.BSO.4.64.0702061636390.28908@resin.csoft.net
Whole thread Raw
In response to Proposal: TABLE functions  ("Pavel Stehule" <pavel.stehule@hotmail.com>)
Responses Re: Proposal: TABLE functions  ("Pavel Stehule" <pavel.stehule@hotmail.com>)
List pgsql-hackers
On Tue, 6 Feb 2007, Pavel Stehule wrote:

> Hello,
>
> Currently PostgreSQL support set returning functions.
>
> ANSI SQL 2003 goes with new type of functions - table functions. With this
> syntax
>
> CREATE FUNCTION foo() RETURNS TABLE (c1 t1, ... )
>
> PostgreSQL equal statements are:
>
> CREATE TYPE tmptype AS (c1 t1, ...)
> CREATE FUNCTION ... RETURNS SETOF tmptype AS ...

or you can do
CREATE FUNCTION foo(OUT c1 t1, OUT ...) RETURNS SETOF record AS ...

But I think this would be nice, I think the OUT parameters make less sense
than saying RETURNS TABLE(...).  But what about functions not returning
SETOF?



--
The Schwine-Kitzenger Institute study of 47 men over the age of 100
showed that all had these things in common:
(1) They all had moderate appetites.(2) They all came from middle class homes(3) All but two of them were dead.


pgsql-hackers by date:

Previous
From: Jan Wieck
Date:
Subject: Re: Proposal: Commit timestamp
Next
From: Marc Munro
Date:
Subject: Re: referential Integrity and SHARE locks