On 12/29/2014 03:56 PM, David Johnston wrote:





​So you think psql should issue "COMMIT;" even if it is exiting due to
"ON_ERROR_STOP"?

I say yes, if it is a non-SQL error. As Viktor stated, SQL errors abort the transaction.


Whether you do or don't can you show me where in the documentation the
current behavior is described?

Your biggest issue seems to be with --single-transaction and ON_ERROR_STOP so:

--single-transaction

When psql executes a script, adding this option wraps BEGIN/COMMIT around the script to execute it as a single transaction.

Therefore:

BEGIN;
script
COMMIT;

I would and have agreed with your previous statements that it is not clear enough that \i is not an SQL command and an error with same is ignored by the transaction. Outside of that I see no problem.


​David J.​



--
Adrian Klaver
adrian.kla...@aklaver.com


--
Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general

Reply via email to