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

From Fabien COELHO
Subject Re: unexpected psql "feature"
Date
Msg-id alpine.DEB.2.20.1607132336410.26777@sto
Whole thread Raw
In response to Re: unexpected psql "feature"  (Tom Lane <tgl@sss.pgh.pa.us>)
Responses Re: unexpected psql "feature"
Re: unexpected psql "feature"
List 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.

pgsql-hackers by date:

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