Re: functions returning records - Mailing list pgsql-hackers

From reinoud@xs4all.nl (Reinoud van Leeuwen)
Subject Re: functions returning records
Date
Msg-id 3b8c18d8.1863735110@smtp.xs4all.nl
Whole thread Raw
In response to functions returning records  (Alex Pilosov <alex@pilosoft.com>)
Responses Re: functions returning records  (Alex Pilosov <alex@pilosoft.com>)
List pgsql-hackers
On Tue, 26 Jun 2001 17:11:47 -0400 (EDT), you wrote:

>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.

Coming from a Sybase environment I would love to have functions return
a result set. A few things to think of:
1: will it be possible to return multiple result sets? (in Sybase any
select statement that is not redirected to variables or a table goes
to the client, so it is quite common to do multiple selects). Does the
postgresql client library support this?

2: will it be possible to put a single result set in a table.
Something like "resultfunction (argument) INTO TABLENAME" or "INSERT
INTO TABLENAME resultfunction(argument)

-- 
__________________________________________________
"Nothing is as subjective as reality"
Reinoud van Leeuwen       reinoud@xs4all.nl
http://www.xs4all.nl/~reinoud
__________________________________________________


pgsql-hackers by date:

Previous
From: Bruce Momjian
Date:
Subject: Re: Re: Encrypting pg_shadow passwords
Next
From: Tatsuo Ishii
Date:
Subject: Re: Benchmarking