Re: Functions returning multiple rowsets - Mailing list pgsql-general

From Pavel Stehule
Subject Re: Functions returning multiple rowsets
Date
Msg-id 162867790909281029v967ed09geaa202041c58a79@mail.gmail.com
Whole thread Raw
In response to Functions returning multiple rowsets  (Thom Brown <thombrown@gmail.com>)
List pgsql-general
Hello

2009/9/28 Thom Brown <thombrown@gmail.com>:
> Hi,
>
> Is it possible to create a function using 'SQL' as language which could
> return multiple rowsets, such as "SELECT * FROM TABLE1; SELECT * FROM
> TABLE2;" where both results are returned in the output?  I know this can be
> done in stored procedures in other RBDMS but can this be done in a function?
>

it is possible, but not directly. You can returns setof refcursors

see http://www.postgresql.org/docs/8.2/static/plpgsql-cursors.html

regards
Pavel Stehule

> Thanks
>
> Thom
>

pgsql-general by date:

Previous
From: John R Pierce
Date:
Subject: Re: sync structures
Next
From: Reid Thompson
Date:
Subject: Re: computed values in plpgsql