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

From Tom Lane
Subject Re: unexpected psql "feature"
Date
Msg-id 2946.1468445760@sss.pgh.pa.us
Whole thread Raw
In response to unexpected psql "feature"  (Fabien COELHO <coelho@cri.ensmp.fr>)
Responses Re: unexpected psql "feature"  (Fabien COELHO <coelho@cri.ensmp.fr>)
List pgsql-hackers
Fabien COELHO <coelho@cri.ensmp.fr> writes:
> Hello devs,

> Although this is probably a "feature", it is a weird one:

>   $ psql
>   psql (9.6beta2)
>   fabien=# SELECT 1 AS one \;
>   fabien-# SELECT 2 AS two ;
>    two
>   -----
>      2
>   (1 row)

> Where is my "1"?

> 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.

> 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.
        regards, tom lane



pgsql-hackers by date:

Previous
From: Fabien COELHO
Date:
Subject: Re: unexpected psql "feature"
Next
From: Fabien COELHO
Date:
Subject: Re: unexpected psql "feature"