Re: unexpected psql "feature"

Поиск
Список
Период
Сортировка
От Fabien COELHO
Тема Re: unexpected psql "feature"
Дата
Msg-id alpine.DEB.2.20.1607132336410.26777@sto
обсуждение исходный текст
Ответ на Re: unexpected psql "feature"  (Tom Lane <tgl@sss.pgh.pa.us>)
Ответы Re: unexpected psql "feature"  ("David G. Johnston" <david.g.johnston@gmail.com>)
Re: unexpected psql "feature"  ("David G. Johnston" <david.g.johnston@gmail.com>)
Список 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 по дате отправления:

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: unexpected psql "feature"
Следующее
От: "David G. Johnston"
Дата:
Сообщение: Re: unexpected psql "feature"