pg.ddx.io  pgsql-bugs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: zhangjinyu <beijing_pg@163.com>
To: pgsql-bugs@postgresql.org
Subject: Re: BUG #13541: There is a visibility issue when run some DDL and Query. The time window is very shot
Date: Fri, 14 Aug 2015 04:45:34 -0700 (MST)
Message-ID: <1439552734803-5862147.post@n5.nabble.com> (raw)
In-Reply-To: <CAJrrPGd--dTUoRpwiSmNVpa56sbCMMB-xB4=Qc4um1NNnt4uhQ@mail.gmail.com>
References: <20150807121643.32633.60549@wrigleys.postgresql.org>
	<CAJrrPGd--dTUoRpwiSmNVpa56sbCMMB-xB4=Qc4um1NNnt4uhQ@mail.gmail.com>
List-Unsubscribe: <mailto:majordomo@postgresql.org?body=unsub%20pgsql-bugs>

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-t...
Sent from the PostgreSQL - bugs mailing list archive at Nabble.com.


-- 
Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-bugs



view thread (4+ messages)  latest in thread

Message-ID: <1439552734803-5862147.post@n5.nabble.com>
Permalink:  ../1439552734803-5862147.post@n5.nabble.com/
Also on:    postgresql.org/message-id/1439552734803-5862147.post@n5.nabble.com

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-bugs@postgresql.org
  Cc: beijing_pg@163.com
  Subject: Re: BUG #13541: There is a visibility issue when run some DDL and Query. The time window is very shot
  In-Reply-To: <1439552734803-5862147.post@n5.nabble.com>
  References: <20150807121643.32633.60549@wrigleys.postgresql.org> <CAJrrPGd--dTUoRpwiSmNVpa56sbCMMB-xB4=Qc4um1NNnt4uhQ@mail.gmail.com> <1439552734803-5862147.post@n5.nabble.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox