Re: Re: BUG #18750: Inappropriate update when it is blocked in RC - Mailing list pgsql-bugs

From Pantelis Theodosiou
Subject Re: Re: BUG #18750: Inappropriate update when it is blocked in RC
Date
Msg-id CAE3TBxxaH_3t9mW8Znc9Cm5=MFWw7ojZvO2OQKEEaM4MYAiiaA@mail.gmail.com
Whole thread Raw
In response to Re: Re: BUG #18750: Inappropriate update when it is blocked in RC  (yrshen@stu.xidian.edu.cn)
List pgsql-bugs


On Wed, Dec 25, 2024 at 7:58 AM <yrshen@stu.xidian.edu.cn> wrote:
Thank you very much for your explanation. So, under the READ COMMITTED of PostgreSQL, the UPDATE statement of Tx2 will only re-evaluate and update the initial row (null, 1), which it initially wanted to update, if the (null, 1) is then changed to (1, 3) by Tx1. Therefore, the expected result of the case is [(1,3), (1,2)] according to the rule of PostgreSQL instead of [(1, 2), (1, 2)], am I right?
 
Tx2  initially wanted to update the (1,1) row (WHERE a IS NOT NULL), which was then changed to (1,3) by Tx1. This is the row that Tx2 UPDATE statement will re-evaluate and update to (1,2).
The initially (null,1) row which is then changed to (1,3) by Tx1 is not touched by Tx2.

The expected result of the case is [(1,3), (1,2)] , that is correct.

pgsql-bugs by date:

Previous
From: yrshen@stu.xidian.edu.cn
Date:
Subject: Re: Re: BUG #18750: Inappropriate update when it is blocked in RC
Next
From: Tomas Vondra
Date:
Subject: Re: Corrupt index lead to skipped autovacuum