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: Alvaro Herrera <alvherre(at)dcc(dot)uchile(dot)cl>
Cc: Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us>,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-02 14:22:28
Message-ID: (view raw, whole thread or download thread mbox)
Lists: pgsql-hackers
Alvaro Herrera <alvherre(at)dcc(dot)uchile(dot)cl> writes:
> On Wed, Jun 02, 2004 at 09:52:28AM -0400, Tom Lane wrote:
>> AFAICS your proposal does not support this.  The two cursors' snapshots
>> will differ only in the recorded current-cid for the outer transaction.
>> If the subtrans has overwritten xmin/cmin, there is no way to make that
>> decision correctly.

> Why would it overwrite cmin?  Only a new xmin is needed (and cmax and
> xmax, but the cursors don't care about those)

If you overwrite xmin and not cmin, you've created a nonsensical
situation.  How do you distinguish this tuple from tuples created by the
subxact itself?  More generally, cmin is only meaningful in combination
with a particular transaction ID; you can't just arbitrarily replace
xmin without changing cmin.

I've been trying to think of ways to solve these problems by having a
main xact and all its subxacts share a common CID sequence (ie, a
subxact would have its own xid but would not start CID over at one).
If you assume that, then Bruce's idea may indeed work, since you would
never replace xmin in a way that would shift the interpretation of cmin
into a different CID sequence.  But I suspect there is a simpler way to
solve it given that constraint.

			regards, tom lane

In response to


pgsql-hackers by date

Next:From: Christopher Kings-LynneDate: 2004-06-02 14:29:21
Subject: Re: ACLs versus ALTER OWNER
Previous:From: Alvaro HerreraDate: 2004-06-02 14:03:15
Subject: Re: Nested transactions and tuple header info

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