Re: BUG #13541: There is a visibility issue when run some DDL and Query. The time window is very shot

From: zhangjinyu <beijing_pg(at)163(dot)com>
To: pgsql-bugs(at)postgresql(dot)org
Subject: Re: BUG #13541: There is a visibility issue when run some DDL and Query. The time window is very shot
Date: 2015-08-14 11:45:34
Message-ID: 1439552734803-5862147.post@n5.nabble.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs pgsql-docs

The test cases is not clear in last mail, the following shows all test
cases.
1. Table precondition
create table t(c1 int);
create table t2(c1 int):
insert into t values(1),(2),(3);
select xmin from t ; (xmin=10043)
2. Step1:
session1: begin transaction isolation level repeatable read;
select * from t2; (query on other table only for get
snapshot)
Step2:
session2: alter table t alter c1 set data type char(10);
select xmin from t; (new xid)
Step3:
session1: select xmin from t; (you can see 0 row, because the
snapshot is the same as the first query when transaction isolation level is
repeatable read.)

The DDL query(alter ...set data type ) rewrites all tuples with new
transaction xid, so if the transaction isolation level is repeatable read,
that will cause wrong result. Which DDL query rewrite all tuples with new
xid?

--
View this message in context: http://postgresql.nabble.com/BUG-13541-There-is-a-visibility-issue-when-run-some-DDL-and-Query-The-time-window-is-very-shot-tp5861304p5862147.html
Sent from the PostgreSQL - bugs mailing list archive at Nabble.com.

In response to

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message feikesteenbergen 2015-08-14 12:54:50 BUG #13571: sql-only extension segfaults backend during creation
Previous Message Greg Stark 2015-08-13 22:50:05 Re: BUG #13559: WAL replay stuck after DROP VIEW

Browse pgsql-docs by date

  From Date Subject
Next Message Tom Lane 2015-08-14 14:23:10 Re: [BUGS] Re: BUG #13541: There is a visibility issue when run some DDL and Query. The time window is very shot
Previous Message Dmitry Igrishin 2015-08-11 11:51:28 Re: 36.3 Writing Tigger Functions in C