BUG #17017: Two versions of the same row of records are returned in one query

From: PG Bug reporting form <noreply(at)postgresql(dot)org>
To: pgsql-bugs(at)lists(dot)postgresql(dot)org
Cc: lpy(dot)henu(at)gmail(dot)com
Subject: BUG #17017: Two versions of the same row of records are returned in one query
Date: 2021-05-18 13:26:24
Message-ID: 17017-c37dbbadb77cfde9@postgresql.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

The following bug has been logged on the website:

Bug reference: 17017
Logged by: 刘沛源
Email address: lpy(dot)henu(at)gmail(dot)com
PostgreSQL version: 9.6.21
Operating system: CentOS Linux 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 3

However, it returns two rows:
2 4
2 3

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message PG Bug reporting form 2021-05-18 13:49:19 BUG #17018: Two versions of the same row of records are returned in one query
Previous Message Jan Kort 2021-05-18 12:46:24 Query with straightforward plan changes and becomes 6520 times slower after VACUUM ANALYZE