Craig Ringer <cr...@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 -- Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-bugs