Skip site navigation (1) Skip section navigation (2)

Re: Nested transactions and tuple header info

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us>
Cc: Alvaro Herrera <alvherre(at)dcc(dot)uchile(dot)cl>,Manfred Koizar <mkoi-pg(at)aon(dot)at>,David Blasby <dblasby(at)refractions(dot)net>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: Nested transactions and tuple header info
Date: 2004-06-01 23:28:59
Message-ID: 17693.1086132539@sss.pgh.pa.us (view raw or flat)
Thread:
Lists: pgsql-hackers
Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)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

In response to

Responses

pgsql-hackers by date

Next:From: Neil ConwayDate: 2004-06-01 23:49:54
Subject: Re: Converting postgresql.conf parameters to kilobytes
Previous:From: Alvaro HerreraDate: 2004-06-01 22:55:39
Subject: Re: Nested transactions and tuple header info

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group