Re: Rollback on include error in psql - Mailing list pgsql-general

From Adrian Klaver
Subject Re: Rollback on include error in psql
Date
Msg-id 54A1ED2C.2070701@aklaver.com
Whole thread Raw
In response to Re: Rollback on include error in psql  (David Johnston <david.g.johnston@gmail.com>)
Responses Re: Rollback on include error in psql
List pgsql-general
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.klaver@aklaver.com


pgsql-general by date:

Previous
From: Tom Lane
Date:
Subject: Re: Hostnames, IDNs, Punycode and Unicode Case Folding
Next
From: Mike Cardwell
Date:
Subject: Re: Hostnames, IDNs, Punycode and Unicode Case Folding