Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1ZQDQn-0006sK-Gb for pgsql-bugs@arkaria.postgresql.org; Fri, 14 Aug 2015 11:45:53 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.84) (envelope-from ) id 1ZQDQm-000464-Ct for pgsql-bugs@arkaria.postgresql.org; Fri, 14 Aug 2015 11:45:52 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84) (envelope-from ) id 1ZQDQk-00045v-Vf for pgsql-bugs@postgresql.org; Fri, 14 Aug 2015 11:45:51 +0000 Received: from mbob.nabble.com ([162.253.133.15]) by magus.postgresql.org with esmtp (Exim 4.84) (envelope-from ) id 1ZQDQc-0006DV-6D for pgsql-bugs@postgresql.org; Fri, 14 Aug 2015 11:45:50 +0000 Received: from msam.nabble.com (unknown [162.253.133.85]) by mbob.nabble.com (Postfix) with ESMTP id A019B1332968 for ; Fri, 14 Aug 2015 04:44:40 -0700 (PDT) Date: Fri, 14 Aug 2015 04:45:34 -0700 (MST) From: zhangjinyu To: pgsql-bugs@postgresql.org Message-ID: <1439552734803-5862147.post@n5.nabble.com> In-Reply-To: References: <20150807121643.32633.60549@wrigleys.postgresql.org> Subject: Re: BUG #13541: There is a visibility issue when run some DDL and Query. The time window is very shot MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Pg-Spam-Score: -1.9 (-) List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-bugs Precedence: bulk Sender: pgsql-bugs-owner@postgresql.org 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. -- Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-bugs