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

Re: Re: new patch of MERGE (merge_204) & a question about duplicated ctid

From: Florian Pflug <fgp(at)phlo(dot)org>
To: Robert Haas <robertmhaas(at)gmail(dot)com>
Cc: Heikki Linnakangas <heikki(dot)linnakangas(at)enterprisedb(dot)com>, Stephen Frost <sfrost(at)snowman(dot)net>, Simon Riggs <simon(at)2ndquadrant(dot)com>, Greg Smith <greg(at)2ndquadrant(dot)com>, Marko Tiikkaja <marko(dot)tiikkaja(at)cs(dot)helsinki(dot)fi>, Boxuan Zhai <bxzhai2010(at)gmail(dot)com>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: Re: new patch of MERGE (merge_204) & a question about duplicated ctid
Date: 2011-01-03 16:36:25
Message-ID: C09B4970-016A-4461-83F4-FAC2000E2A4C@phlo.org (view raw or flat)
Thread:
Lists: pgsql-hackers
On Jan3, 2011, at 17:21 , Robert Haas wrote:
> On Mon, Jan 3, 2011 at 11:08 AM, Heikki Linnakangas
>> In serializable mode you get a serialization error.
> 
> I don't think this part is true.  You can certainly do this:
> 
> CREATE TABLE test (a int);
> BEGIN TRANSACTION ISOLATION LEVEL SERIALIZABLE;
> SELECT * FROM test;
> <in another session, insert (1) into test>
> LOCK TABLE test IN SHARE MODE; -- or just LOCK TABLE test, if you prefer
> SELECT * FROM test;  -- still ain't there
> INSERT INTO test VALUES (1);

In SERIALIZABLE mode, you need to take any table-level locks before obtaining
a snapshot. There's even a warning about this in the docs somewhere IIRC...

best regards,
Florian Pflug


In response to

Responses

pgsql-hackers by date

Next:From: Simon RiggsDate: 2011-01-03 16:49:23
Subject: Re: Re: new patch of MERGE (merge_204) & a question about duplicated ctid
Previous:From: Heikki LinnakangasDate: 2011-01-03 16:35:18
Subject: Re: Re: new patch of MERGE (merge_204) & a question about duplicated ctid

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