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

From Martijn van Oosterhout
Subject Re: Returning multiple result sets
Date
Msg-id 20051120213046.GG32031@svana.org
Whole thread Raw
In response to Re: Returning multiple result sets  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-hackers
On Sun, Nov 20, 2005 at 03:41:36PM -0500, Tom Lane wrote:
> Martijn van Oosterhout <kleptog@svana.org> writes:
> > Urk! I don't think anyone is suggesting that resultsets can be
> > interleaved.
>
> No?  If not, why not?  The main reason why this is being pushed, IIRC,
> is the claim that "you can do this easily in other databases".  If you
> don't want to support interleaved retrieval of multiple datasets, you
> had better be prepared to prove that no other popular database can
> do it either.

I don't know if I can prove it. however, I do have a few datapoints:

1. In SQLJ when you call a stored procedure that returns multiple
datasets, you have to close a resultset before you can start on the
next one.

: Result sets are returned to the calling program in the same order
: that their cursors are opened in the stored procedure. When there are
: no more result sets to retrieve, getNextResultSet returns a null
: value.

http://publib.boulder.ibm.com/infocenter/dzichelp/v2r2/index.jsp?topic=/com.ibm.db2.doc.java/bjnkmstr81.htm

2. ASP seems to have the same restriction

http://www.w3schools.com/ado/met_rs_nextrecordset.asp

Note, we should distinguish here between (a) being able to send a query
before you've retreived all the data of the current one and having the
results of those interleaved, and (b) having the results of a single
query return two results sets interleaved.

I beleive the first is supported by other DBs but not us (other than
explicit cursors). I don't think any support the latter, but I can't
claim to have checked them all. Your point is taken though, I'll see if
I can find any evidence one way or the other.

Have a nice day,
--
Martijn van Oosterhout   <kleptog@svana.org>   http://svana.org/kleptog/
> Patent. n. Genius is 5% inspiration and 95% perspiration. A patent is a
> tool for doing 5% of the work and then sitting around waiting for someone
> else to do the other 95% so you can sue them.

pgsql-hackers by date:

Previous
From: "Magnus Hagander"
Date:
Subject: Re: Returning multiple result sets
Next
From: Martijn van Oosterhout
Date:
Subject: Re: Returning multiple result sets