Re: [GENERAL] xmin increasing within a transaction block? - Mailing list pgsql-general

From Luca Ferrari
Subject Re: [GENERAL] xmin increasing within a transaction block?
Date
Msg-id CAKoxK+6K3gjONB6qkviTa-==b1XWcvx5Lu11zKRHFYydh860fg@mail.gmail.com
Whole thread Raw
In response to Re: [GENERAL] xmin increasing within a transaction block?  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-general
On Mon, Nov 6, 2017 at 3:26 PM, Tom Lane <tgl@sss.pgh.pa.us> wrote:
> Alvaro Herrera <alvherre@alvh.no-ip.org> writes:
>> Luca Ferrari wrote:
>>> Why is xmin greater than the current transaction id (and most notably
>>> not "fixed")?
>
>> Something is using subtransactions there.  My first guess would be that
>> there are triggers with EXCEPTION blocks, but your example doesn't show
>> any.  Or maybe you have event triggers.
>
> I can reproduce the example if I "\set ON_ERROR_ROLLBACK on" in psql.
>


Shame on me, I did forgot to have enabled that in my ~/.psqlrc file
(and did not hit an error within the transaction block to see it was
aborting). And in fact, the manual page for psql reports that
ON_ERROR_ROLLBACK:

The error rollback mode works by issuing an implicit SAVEPOINT for you,
just before each command that is in a transaction block, and
then rolling back to the savepoint if the command fails.

Sorry for the noise.
Thanks,
Luca


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

pgsql-general by date:

Previous
From: Sachin Kotwal
Date:
Subject: Re: [GENERAL] Naming conventions for column names
Next
From: Karsten Hilbert
Date:
Subject: Re: [GENERAL] Naming conventions for column names