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

Re: Nested transactions and tuple header info

From: Alvaro Herrera <alvherre(at)dcc(dot)uchile(dot)cl>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
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:03:15
Message-ID: 20040602140315.GC977@dcc.uchile.cl (view raw or flat)
Thread:
Lists: pgsql-hackers
On Wed, Jun 02, 2004 at 09:52:28AM -0400, Tom Lane wrote:

> 	BEGIN;
> 	DECLARE CURSOR c1 FOR SELECT * FROM a ...;
> 	INSERT INTO a VALUES(...);	-- call this row x
> 	DECLARE CURSOR c2 FOR SELECT * FROM a ...;
> 	BEGIN;
> 	DELETE FROM a WHERE ...;	-- assume this deletes row x
> 	ROLLBACK;
> 	FETCH FROM c1;			-- must NOT see row x
> 	FETCH FROM c2;			-- must see row x
> 
> 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)

-- 
Alvaro Herrera (<alvherre[a]dcc.uchile.cl>)
"La fuerza no está en los medios físicos
sino que reside en una voluntad indomable" (Gandhi)


In response to

Responses

pgsql-hackers by date

Next:From: Tom LaneDate: 2004-06-02 14:22:28
Subject: Re: Nested transactions and tuple header info
Previous:From: Shridhar DaithankarDate: 2004-06-02 13:53:35
Subject: Re: Converting postgresql.conf parameters to kilobytes

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