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?