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

From Alvaro Herrera
Subject Re: Nested transactions and tuple header info
Date
Msg-id 20040602140315.GC977@dcc.uchile.cl
Whole thread Raw
In response to Re: Nested transactions and tuple header info  (Tom Lane <tgl@sss.pgh.pa.us>)
Responses Re: Nested transactions and tuple header info
List 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)



pgsql-hackers by date:

Previous
From: Shridhar Daithankar
Date:
Subject: Re: Converting postgresql.conf parameters to kilobytes
Next
From: Tom Lane
Date:
Subject: Re: Nested transactions and tuple header info