ALTER TABLE transaction isolation problem

From: DT <kurt023(at)hotmail(dot)com>
To: "pgsql-general(at)postgresql(dot)org" <pgsql-general(at)postgresql(dot)org>
Subject: ALTER TABLE transaction isolation problem
Date: 2013-09-02 13:35:46
Message-ID: BAY173-W46D1F22CB9F733A8253976E6300@phx.gbl
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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;COMMITpostgres=# BEGIN;BEGINpostgres=# SET TRANSACTION ISOLATION LEVEL SERIALIZABLE;SETpostgres=# 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?

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Tim Kane 2013-09-02 14:54:43 psql --command option ignores --variable's
Previous Message Gianni Ceccarelli 2013-09-02 12:59:44 Re: SSI and predicate locks - a non-trivial use case