pg.ddx.io  pgsql-bugs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: PG Bug reporting form <noreply@postgresql.org>
To: pgsql-bugs@lists.postgresql.org
Cc: 52194501011@stu.ecnu.edu.cn
Subject: BUG #17018: Two versions of the same row of records are returned in one query
Date: Tue, 18 May 2021 13:49:19 +0000
Message-ID: <17018-505b3c8bd8b551ff@postgresql.org> (raw)

The following bug has been logged on the website:

Bug reference:      17018
Logged by:          Keqiang Li
Email address:      52194501011@stu.ecnu.edu.cn
PostgreSQL version: 9.6.21
Operating system:   CentosLinux release 7.4.1708 ( Core)
Description:        

Schema and Initial data: 
Create Table t(a int primary key, b int);
Insert into t values(1,2);
Insert into t values(2,3);

Operation:
There are two sessions executing at the same time.

[Time0, SessonA]
> Begin;
> set transaction isolation level repeatable read;
> Select * from t where a=1;

[Time1, SessonB]
> Begin;
> set transaction isolation level read committed;
> Delete from t where a=2;
> Commit;

[Time2, SessonA]
> Insert into t values(2,4);
> Select * from t where a=2;

Here, we expect PostgreSQL Server to return a row:
2 4

However, it returns two rows:
2 4
2 3



Message-ID: <17018-505b3c8bd8b551ff@postgresql.org>
Permalink:  ../17018-505b3c8bd8b551ff@postgresql.org/
Also on:    postgresql.org/message-id/17018-505b3c8bd8b551ff@postgresql.org

 · 

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 using the --to and --cc options:
  reply via email

  To: pgsql-bugs@postgresql.org
  Cc: noreply@postgresql.org, pgsql-bugs@lists.postgresql.org, 52194501011@stu.ecnu.edu.cn
  Subject: Re: BUG #17018: Two versions of the same row of records are returned in one query
  In-Reply-To: <17018-505b3c8bd8b551ff@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