Re: Rule system goes weird with SELECT queries - Mailing list pgsql-hackers

From Tom Lane
Subject Re: Rule system goes weird with SELECT queries
Date
Msg-id 12897.972000611@sss.pgh.pa.us
Whole thread Raw
In response to Re: Rule system goes weird with SELECT queries  ("Kevin O'Gorman" <kogorman@pacbell.net>)
List pgsql-hackers
"Kevin O'Gorman" <kogorman@pacbell.net> writes:
> When I actually *execute* the 'insert into dummy', I get the output of
> only one select: the second one listed.  Is there something about
> executing a list I don't know about, or is this also old news??

If you're using psql then that doesn't surprise me, because psql submits
queries via PQexec, and PQexec is not capable of dealing with multiple
result sets per submitted query string --- its API provides no way to
handle that, so it just bit-buckets all but the last command result.

This would work OK in an app that uses PQsendQuery followed by a
PQgetResult loop, however.  See
http://www.postgresql.org/devel-corner/docs/postgres/libpq-async.htm

I've been kind of wanting to update psql to use these lower-level
routines, but that item has been languishing in the to-do queue for
a couple years now...
        regards, tom lane


pgsql-hackers by date:

Previous
From: "Kevin O'Gorman"
Date:
Subject: Re: Rule system goes weird with SELECT queries
Next
From: "Kevin O'Gorman"
Date:
Subject: Proposed relaxation of CREATE RULE syntax