Tom Lane writes:
> Peter Eisentraut <peter_e@gmx.net> writes:
> > psql -c 'select * from pg_class; select * from no_such_table;'
> > Shouldn't this at least give me the result of the first select before
> > aborting the second?
>
> The behavior you are complaining of is not the backend's fault.
> The reason it acts that way is that psql is feeding the entire -c
> string to the backend as one query, and not paying any attention
> to the possibility that multiple query results might be available
> from the string.
No, I think there is another problem. How about something without
selects:
$ psql -c 'delete from pk; delete from xx;'
ERROR: Relation 'xx' does not exist
"pk" exists, but nothing is deleted.
$ psql -c 'drop user joe; drop user foo;'
ERROR: DROP USER: user "foo" does not exist
User "joe" exists, but it is not dropped.
--
Peter Eisentraut peter_e@gmx.net http://funkturm.homeip.net/~peter