From: PG Bug reporting form <noreply@postgresql.org>
To: pgsql-bugs@lists.postgresql.org
Cc: dddinary@163.com
Subject: BUG #17301: SELECT gets weird result while two transactions are submitted concurrently
Date: Sat, 27 Nov 2021 18:14:01 +0000
Message-ID: <17301-61fbc4ef6a49bf89@postgresql.org> (raw)
The following bug has been logged on the website:
Bug reference: 17301
Logged by: Dinary Dai
Email address: dddinary@163.com
PostgreSQL version: 14.0
Operating system: Ubuntu
Description:
/* init */ create table t(a int primary key, b int);
/* init */ insert into t values (1, 2), (2, 3)
/* t1 */ begin;
/* t1 */ set transaction isolation level repeatable read;
/* t1 */ select * from t where a = 1;
/* t2 */ begin;
/* t2 */ set transaction isolation level repeatable read;
/* t2 */ delete from t where a = 2;
/* t2 */ commit;
/* t1 */ update t set a = 2 where a = 1;
/* t1 */ select * from t where a = 2; -- [(2, 3), (2, 2)]
/* t1 */ commit;
The final SELECT statement gets result [(2, 3), (2, 2)], which violates the
primary key constraint on column `a`.
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 using the --to and --cc options:
reply via email
To: pgsql-bugs@postgresql.org
Cc: noreply@postgresql.org, pgsql-bugs@lists.postgresql.org, dddinary@163.com
Subject: Re: BUG #17301: SELECT gets weird result while two transactions are submitted concurrently
In-Reply-To: <17301-61fbc4ef6a49bf89@postgresql.org>
* 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