Re: SQL-Invoked Procedures for 8.1

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Oliver Jowett <oliver(at)opencloud(dot)com>
Cc: pgsql-hackers(at)postgresql(dot)org
Subject: Re: SQL-Invoked Procedures for 8.1
Date: 2004-09-23 20:54:28
Message-ID: 11834.1095972868@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Oliver Jowett <oliver(at)opencloud(dot)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

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Oliver Jowett 2004-09-23 21:03:03 Re: SQL-Invoked Procedures for 8.1
Previous Message Oliver Jowett 2004-09-23 20:40:43 Re: SQL-Invoked Procedures for 8.1