From: | "Pavel Stehule" <pavel(dot)stehule(at)hotmail(dot)com> |
---|---|
To: | pgsql-patches(at)postgresql(dot)org |
Subject: | Table function support |
Date: | 2007-02-11 18:39:42 |
Message-ID: | BAY114-F3E354FADBEE8FA63E7FA2F9920@phx.gbl |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-patches |
Hello
this patch allows using SQL2003 syntax for set returning functions. It is
based on using new type of argmode - PROARGMODE_TABLE.
Proposal: http://archives.postgresql.org/pgsql-hackers/2007-02/msg00318.php
Sample:
CREATE FUNCTION foof(a int)
RETURNS TABLE(a int, b int) AS
$$ SELECT x, y FROM Foo WHERE x < a $$ LANGUAGE sql;
CREATE FUNCTION fooff(a int)
RETURNS TABLE(a int, b int) AS $$
BEGIN
RETURN TABLE(SELECT * FRON Foo WHERE x < a);
END; $$ LANGUAGE plpgsql;
This patch enhance plpgsql stmt return too (table expression support).
Conformance with SQL2003:
T326 Table functions
Description: SIGMOD Record, Vol. 33, No. 1, March 2004
Regards
Pavel Stehule
_________________________________________________________________
Emotikony a pozadi programu MSN Messenger ozivi vasi konverzaci.
http://messenger.msn.cz/
Attachment | Content-Type | Size |
---|---|---|
table_functions.diff | text/x-patch | 29.4 KB |
From | Date | Subject | |
---|---|---|---|
Next Message | Greg Smith | 2007-02-12 01:32:34 | New features for pgbench |
Previous Message | Michael Meskes | 2007-02-11 15:16:04 | Re: patch for ECPG (BUG #2956: ECPG does not treat multibyte characters correctly.) |