Re: Support for functions returning mutliple result sets?

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: bill(at)mcmilleon(dot)com
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: Support for functions returning mutliple result sets?
Date: 2004-01-23 04:21:56
Message-ID: 23868.1074831716@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

<bill(dot)postgresql-users(at)mcmilleon(dot)com> writes:
> Does postgres support returning multiple sets from a function?

Not directly. You can fake it in some cases by returning several open
cursors and expecting the caller to fetch from those cursors. However,
if you can't write SQL queries that can be executed to return each of
the needed return sets, you're out of luck --- there's nothing so
flexible as RETURN NEXT.

I don't think this is an unfixable limitation; the needed mechanisms
all exist, it's a matter of figuring out what a reasonable syntactic
representation would look like. Any thoughts?

regards, tom lane

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Tom Lane 2004-01-23 04:29:05 Re: Parsing bug?
Previous Message Tom Lane 2004-01-23 03:51:27 Re: embedded/"serverless" (Re: serverless postgresql)