ALTER TABLE transaction isolation problem

Поиск
Список
Период
Сортировка
От DT
Тема ALTER TABLE transaction isolation problem
Дата
Msg-id BAY173-W46D1F22CB9F733A8253976E6300@phx.gbl
обсуждение исходный текст
Ответы Re: ALTER TABLE transaction isolation problem  (David Johnston <polobo@yahoo.com>)
Re: ALTER TABLE transaction isolation problem  (Kevin Grittner <kgrittn@ymail.com>)
Список 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 по дате отправления:

Предыдущее
От: Gianni Ceccarelli
Дата:
Сообщение: Re: SSI and predicate locks - a non-trivial use case
Следующее
От: Tim Kane
Дата:
Сообщение: psql --command option ignores --variable's