Re: Table function support - Mailing list pgsql-patches

From Pavel Stehule
Subject Re: Table function support
Date
Msg-id BAY20-F1148EBD459F9926C5343CEF95F0@phx.gbl
Whole thread Raw
In response to Re: Table function support  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-patches
>I've been looking at this, and my feeling is that we should drop the
>PROARGMODE_TABLE business and just define RETURNS TABLE(x int, y int)
>as exactly equivalent to RETURNS SETOF RECORD with x and y treated as
>OUT parameters.  There isn't any advantage to distinguishing the cases
>that outweighs breaking client code that looks at pg_proc.proargmodes.
>I don't believe that the SQL spec prevents us from exposing those
>parameter names to PL functions, especially since none of our PLs are
>in the standard at all.
>

Reason for PROARGMODE_TABLE was protection before name's collision, and x,
and y are table attributies (not variables) and then we are protected before
collision. It's shortcut for

create function foo() returns setof record as ...
select * from foo() as (x int, y int);

Regards
Pavel Stehule

_________________________________________________________________
Najdete si svou lasku a nove pratele na Match.com. http://www.msn.cz/


pgsql-patches by date:

Previous
From: "Pavel Stehule"
Date:
Subject: Re: Table function support
Next
From: Heikki Linnakangas
Date:
Subject: Re: [HACKERS] Fix mdsync never-ending loop problem