Re: SQL-Invoked Procedures for 8.1 - Mailing list pgsql-hackers

From Tom Lane
Subject Re: SQL-Invoked Procedures for 8.1
Date
Msg-id 11834.1095972868@sss.pgh.pa.us
Whole thread Raw
In response to Re: SQL-Invoked Procedures for 8.1  (Oliver Jowett <oliver@opencloud.com>)
Responses Re: SQL-Invoked Procedures for 8.1
List pgsql-hackers
Oliver Jowett <oliver@opencloud.com> writes:
> The JDBC driver currently sends Describe/Execute and expects exactly one 
> of RowDescription/NoData followed by zero or more DataRows followed by 
> one of CommandComplete/EmptyQueryResponse/PortalSuspended. This seems 
> wrong if there could be multiple resultsets from a single Execute.

This is okay if you know the query was a SELECT, since we don't allow
ON SELECT rules that aren't view-like (ie, DO INSTEAD SELECT something-else).
Non-SELECT queries can return multiple result sets, though, as I
illustrated.  It's probably reasonable for the driver to throw these
away if it's not looking for a resultset at all.  Or you could follow
PQexec's lead and discard all but the last.

> How can clients distinguish multiple resultsets if they're using the 
> extended query protocol?

You'll get multiple repetitions of RowDescription/DataRows.
        regards, tom lane


pgsql-hackers by date:

Previous
From: Oliver Jowett
Date:
Subject: Re: SQL-Invoked Procedures for 8.1
Next
From: Oliver Jowett
Date:
Subject: Re: SQL-Invoked Procedures for 8.1