Re: BUG #6117: psql -c does not work as expected. a documentation bug? a program bug?

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: BUG #6117: psql -c does not work as expected. a documentation bug? a program bug?
Дата
Msg-id 29983.1310657694@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: BUG #6117: psql -c does not work as expected. a documentation bug? a program bug?  (Craig Ringer <craig@postnewspapers.com.au>)
Ответы Re: BUG #6117: psql -c does not work as expected. a documentation bug? a program bug?  (Aleksey Tsalolikhin <atsaloli.tech@gmail.com>)
Список pgsql-bugs
Craig Ringer <craig@postnewspapers.com.au> writes:
> What's happening is that all of them are processed, but only the output
> for the last one is emitted. I agree that the documentation isn't clear
> about that, and I'm not sure whether or not that was the intended result.
> ...
> Comments anybody? Just fix the docs, or is this a behaviour issue?

This is a byproduct of the fact that psql shoves the -c string out to
the backend as a single Query message, rather than splitting it at
semicolons and sending each command individually, which is what would
happen if you typed a multi-command line normally.

That has a bunch of indirect semantic implications, like the commands
all being done in one transaction and execution of the whole thing
always being abandoned after the first error.

We've talked many times about changing that, but always been too afraid
of breaking user scripts that rely on the current behavior.

We could possibly address Aleksey's complaint without changing the
behavior otherwise, but I'm not sure it's worth the trouble.  So I
vote for document-and-move-on.

            regards, tom lane

В списке pgsql-bugs по дате отправления:

Предыдущее
От: John R Pierce
Дата:
Сообщение: Re: BUG #6118: Server doesn't listen
Следующее
От:
Дата:
Сообщение: Re: BUG #6118: Server doesn't listen