Skip site navigation (1) Skip section navigation (2)

Re: SQL-Invoked Procedures for 8.1

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Hannu Krosing <hannu(at)tm(dot)ee>
Cc: Grant Finnemore <grantf(at)guruhut(dot)co(dot)za>,Magnus Hagander <mha(at)sollentuna(dot)net>,Gavin Sherry <swm(at)linuxworld(dot)com(dot)au>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: SQL-Invoked Procedures for 8.1
Date: 2004-09-23 14:54:01
Message-ID: (view raw, whole thread or download thread mbox)
Lists: pgsql-hackers
Hannu Krosing <hannu(at)tm(dot)ee> writes:
> IIRC support for returning multiple recordsets was removed from
> postgresql fe-be protocol years ago as "nobody ever needs it" ;)

The protocol can still do it, and so can the backend, but it will
certainly break most if not all clients.  Here's an example:

regression=# create table surprise(f1 text);
regression=# create rule r1 as on insert to surprise do
regression-# ( select 'hello' ; select 'how are you' );
regression=# insert into surprise values ('boo');
 how are you
(1 row)


The 'hello' result was in fact computed and sent by the backend, but it
was discarded in libpq (see the documentation about PQexec: only the
last resultset returned by a querystring is returned to the caller).
psql could have printed both results, but it would need to use
PQsendQuery/PQgetResult instead of PQexec.

			regards, tom lane

In response to


pgsql-hackers by date

Next:From: Andrew DunstanDate: 2004-09-23 15:41:16
Subject: Re: Use of zlib
Previous:From: Tom LaneDate: 2004-09-23 14:48:54
Subject: Re: Use of zlib

Privacy Policy | About PostgreSQL
Copyright © 1996-2017 The PostgreSQL Global Development Group