functions returning records - Mailing list pgsql-hackers

From Alex Pilosov
Subject functions returning records
Date
Msg-id Pine.BSO.4.10.10106261707110.21556-100000@spider.pilosoft.com
Whole thread Raw
Responses Re: functions returning records  (reinoud@xs4all.nl (Reinoud van Leeuwen))
Re: functions returning records  (Karel Zak <zakkr@zf.jcu.cz>)
List pgsql-hackers
I started thinking about Tom's idea to implement functions as table
source.

To me, it seems that a very few changes are necessary:
a) parser must be changed to allow functioncall to be a table_ref
(easy)

b) when a Query node is generated out of such a call "select * from foo()"
it should be almost identical to one generated out of "select * from
(select * from foo)" with one distinction: list of query attributes should
be completed based on return type of foo().

c) executor should support execution of such Query node, properly
extracting things out of function's return value and placing them into
result attributes.


If I'm wrong, please correct me.

-alex



pgsql-hackers by date:

Previous
From: "Dmitry G. Mastrukov"
Date:
Subject: New data type: uniqueidentifier
Next
From: Alex Pilosov
Date:
Subject: Re: New data type: uniqueidentifier