ALTER TABLE transaction isolation problem - Mailing list pgsql-general

From DT
Subject ALTER TABLE transaction isolation problem
Date
Msg-id BAY173-W46D1F22CB9F733A8253976E6300@phx.gbl
Whole thread Raw
Responses Re: ALTER TABLE transaction isolation problem  (David Johnston <polobo@yahoo.com>)
Re: ALTER TABLE transaction isolation problem  (Kevin Grittner <kgrittn@ymail.com>)
List pgsql-general
Hi,

  I'm reading code of ALTER TABLE, and I found when target table needs rewrite, tuple inserted into new heap uses current transaction's xid as xmin. Does this behavior satisfy serializable isolation? I wrote some test cases:

CREATE TABLE t1(a INT);
CREATE TABLE t2(a INT);
INSERT INTO t1 VALUES(1);
INSERT INTO t2 VALUES(1);

transaction one:

postgres=# commit;
COMMIT
postgres=# BEGIN;
BEGIN
postgres=# SET TRANSACTION ISOLATION LEVEL SERIALIZABLE;
SET
postgres=# SELECT * FROM t1;
 a
---
 1
(1 rows)

        transaction two execute SQL:  ALTER TABLE t2 ADD COLUMN b INT DEFAULT 1;

postgres=# SELECT * FROM t2;
 a | b
---+---
(0 rows)

Transaction one sees nothing in t2, and i can not give any serial execution order of these two transactions, does it still  satisfy serializable isolation? 



pgsql-general by date:

Previous
From: Gianni Ceccarelli
Date:
Subject: Re: SSI and predicate locks - a non-trivial use case
Next
From: Tim Kane
Date:
Subject: psql --command option ignores --variable's