From: | reinoud(at)xs4all(dot)nl (Reinoud van Leeuwen) |
---|---|
To: | pgsql-hackers(at)postgresql(dot)org |
Subject: | Re: functions returning records |
Date: | 2001-06-26 23:25:23 |
Message-ID: | 3b8c18d8.1863735110@smtp.xs4all.nl |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | 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(at)xs4all(dot)nl
http://www.xs4all.nl/~reinoud
__________________________________________________
From | Date | Subject | |
---|---|---|---|
Next Message | Tatsuo Ishii | 2001-06-27 01:11:23 | Re: Benchmarking |
Previous Message | Bruce Momjian | 2001-06-26 23:17:21 | Re: Re: Encrypting pg_shadow passwords |