Re: Stored procedures and out parameters - Mailing list pgsql-hackers

From Daniel Verite
Subject Re: Stored procedures and out parameters
Date
Msg-id 8a46ad89-f842-4cb9-a6a3-90142374290f@manitou-mail.org
Whole thread Raw
In response to Re: Stored procedures and out parameters  (Shay Rojansky <roji@roji.org>)
List pgsql-hackers
    Shay Rojansky wrote:

> In one way that's good, but I wonder how this squares with the following
> written by David above:
> > 1. A stored procedure should be able to return multiple resultsets with
> different structures.
> > 2. A stored procedure can decide dynamically of the structure of the
> resultset(s) it returns, and the caller will discover it as they're
> returned, not before.

> Both of the above seem to be simply incompatible with the current
> PostgreSQL protocol. Describe currently returns a single RowDescription,
> which describes a single resultset, not more. And as I wrote before, I
> don't see how it's possible with the current protocol for the caller to
> discover the structure of the resultset(s) "as they're returned"

It works at least with the simple query mode, where it's similar
to handling results from a query string containing multiple
statements separated by semicolons.

But it's not clear whether this could work with the extended query
protocol. The doc says that the necessary RowDescription message(s)
would be missing:

  "The possible responses to Execute are the same as those described
   above for queries issued via simple query protocol, except that
   Execute doesn't cause ReadyForQuery or RowDescription to be issued",


Best regards,
--
Daniel Vérité
PostgreSQL-powered mailer: http://www.manitou-mail.org
Twitter: @DanielVerite


pgsql-hackers by date:

Previous
From: Fabien COELHO
Date:
Subject: Re: doc - improve description of default privileges
Next
From: Surafel Temesgen
Date:
Subject: Conflict handling for COPY FROM