Re: unexpected psql "feature" - Mailing list pgsql-hackers

From David G. Johnston
Subject Re: unexpected psql "feature"
Date
Msg-id CAKFQuwaADV-WyLtpB455J_MZ6bT8A6Ld6SU1Zya+Zajejm1JtQ@mail.gmail.com
Whole thread Raw
In response to Re: unexpected psql "feature"  (Fabien COELHO <coelho@cri.ensmp.fr>)
Responses Re: unexpected psql "feature"  (Alvaro Herrera <alvherre@2ndquadrant.com>)
List pgsql-hackers
On Wed, Jul 13, 2016 at 5:44 PM, Fabien COELHO <coelho@cri.ensmp.fr> wrote:

Hello Tom,

Although "\;" behavior is not documented, I would have expected both
results to be shown one after the other, or having a an error, but not a
quiet discard.

See the documentation for PQexec(): all but the last query result is
discarded.

Sure. That is developer-level answer to "why", although it does not really say why the developer chose PQexex over PQsendQuery. At the user-level the behavior is still pretty surprising.

​Lets try putting it this way...

As a psql user I want some way to choose whether I send my query via "PQexec" or "PQsendQuery".  I'm not sure why the "PQexec" access point is undocumented but this "\;" syntax, vis-a-vis ";" provides me that choice.

David J.

pgsql-hackers by date:

Previous
From: "David G. Johnston"
Date:
Subject: Re: unexpected psql "feature"
Next
From: Tom Lane
Date:
Subject: Upcoming PG release schedule