Re: Nested transactions and tuple header info - Mailing list pgsql-hackers

From Tom Lane
Subject Re: Nested transactions and tuple header info
Date
Msg-id 17693.1086132539@sss.pgh.pa.us
Whole thread Raw
In response to Nested transactions and tuple header info  (Bruce Momjian <pgman@candle.pha.pa.us>)
Responses Re: Nested transactions and tuple header info
List pgsql-hackers
Bruce Momjian <pgman@candle.pha.pa.us> writes:
>     BEGIN;    xid=1
>     INSERT a;
>     BEGIN;    xid=2
>     INSERT b;
>     DELETE a; xid=3
>     COMMIT;
>     COMMIT;

> When "DELETE a" happens, we remove the xmin=1 from the tuple header and
> replace it with xmin=3.

You can't change xmin --- this would break visibility tests.  Consider
a cursor opened in the outer transaction after the INSERT a.  It should
be able to see the "a" row (note that this depends on recognizing xid
equality and then comparing cid's within the outer transaction).  If the
subtransaction mangles xmin then it is no longer possible to make this
test correctly.

This is exactly the same argument as not being able to overwrite cmin.
        regards, tom lane


pgsql-hackers by date:

Previous
From: Alvaro Herrera
Date:
Subject: Re: Nested transactions and tuple header info
Next
From: Neil Conway
Date:
Subject: Re: Converting postgresql.conf parameters to kilobytes