Is it possible to return multiple result sets from a Postgres function, like in MSSQL:
`
CREATE PROCEDURE test
AS
SELECT * FROM first_table
SELECT * FROM second_table
`
Is it possible to return multiple result sets from a Postgres function, like in MSSQL:
| ||||
feedback
|
A simpler way has been around since PostgreSQL 8.3 (long before this question was asked!):
Call:
See the manual on RETURN QUERY. | |||
feedback
|
If
[EDIT: Thanks to a commenter (whose name is probably not "null" :) ) for pointing out that | |||||||||||
feedback
|
Yes. Example:
You can of course use an existing table/view or a custom type for the returned type. Example using language SQL:
| ||||
feedback
|
I.o.w. using refcursors :) | |||
feedback
|