Re: unexpected psql "feature"

From: Fabien COELHO <coelho(at)cri(dot)ensmp(dot)fr>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: PostgreSQL Developers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: unexpected psql "feature"
Date: 2016-07-13 21:44:17
Message-ID: alpine.DEB.2.20.1607132336410.26777@sto
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers


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.

>> I would suggest that:
>> - the \; psql feature should be documented somewhere
>> - all results should be shown, not just the last one
>
>> Any opinion?
>
> I do not think changing this is appropriate. All you are likely to
> accomplish is breaking code that does what its author wanted.

Hmmm... My 0.02€: Currently this feature is NOT documented, so somehow it
is not supported, and relying on it seems risky, as it is really a side
effect of the current implementation. If it becomes documented, it could
be made to behave sanely at the same time...

--
Fabien.

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message David G. Johnston 2016-07-13 21:53:48 Re: unexpected psql "feature"
Previous Message Tom Lane 2016-07-13 21:36:00 Re: unexpected psql "feature"