Re: unexpected psql "feature"

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: unexpected psql "feature"
Дата
Msg-id 2946.1468445760@sss.pgh.pa.us
обсуждение исходный текст
Ответ на unexpected psql "feature"  (Fabien COELHO <coelho@cri.ensmp.fr>)
Ответы Re: unexpected psql "feature"  (Fabien COELHO <coelho@cri.ensmp.fr>)
Список 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 по дате отправления:

Предыдущее
От: Fabien COELHO
Дата:
Сообщение: Re: unexpected psql "feature"
Следующее
От: Fabien COELHO
Дата:
Сообщение: Re: unexpected psql "feature"