Re: Returning multiple result sets - Mailing list pgsql-hackers

From Alvaro Herrera
Subject Re: Returning multiple result sets
Date
Msg-id 20051119230208.GB16420@surnet.cl
Whole thread Raw
In response to Re: Returning multiple result sets  (Tom Lane <tgl@sss.pgh.pa.us>)
Responses Re: Returning multiple result sets  (Martijn van Oosterhout <kleptog@svana.org>)
List pgsql-hackers
Tom Lane wrote:
> Martijn van Oosterhout <kleptog@svana.org> writes:
> > So, kill a few birds with one stone. Any thoughts?
> 
> I don't think any of this will actually work :-(.  There's too much code
> that assumes that all the tuples returned by a query are alike, and I
> for one don't feel like trying to find and fix it all.  (Not all of it
> is within our control, either --- this will break client code along with
> the backend.)

Hmm -- probably we could declare that the current libpq API will not
support multiple result sets from one query, and return only the first
one to the application discarding the rest.  (It just occured to me --
what happens if one send multiple SELECTs in a semicolon-separated query
via libpq?).  New apps wanting to take advantage of the new
functionality would need to invoke a different function.

At the protocol level this will need an extension anyway, so clients
using the protocol directly would need to be updated to understand
multiple results.

I know people migrating from SQL Server (maybe others?) are already
having trouble because of our inability to return multiple result sets.
The sooner we do it, the sooner all the code will be fixed ...

-- 
Alvaro Herrera                                http://www.CommandPrompt.com/
PostgreSQL Replication, Consulting, Custom Development, 24x7 support


pgsql-hackers by date:

Previous
From: Josh Berkus
Date:
Subject: Re: PCTFree Results
Next
From: Andrew - Supernews
Date:
Subject: Re: order by, for custom types