Fix handling of updated tuples in the MERGE statement
Alexander Korotkov <akorotkov@postgresql.org>
Fix handling of updated tuples in the MERGE statement This branch missed the IsolationUsesXactSnapshot() check. That led to EPQ on repeatable read and serializable isolation levels. This commit fixes the issue and provides a simple isolation check for that. Backpatch through v15 where MERGE statement was introduced. Reported-by: Tender Wang <tndrwang@gmail.com> Discussion: https://postgr.es/m/CAPpHfdvzZSaNYdj5ac-tYRi6MuuZnYHiUkZ3D-AoY-ny8v%2BS%2Bw%40mail.gmail.com Author: Tender Wang <tndrwang@gmail.com> Reviewed-by: Dean Rasheed <dean.a.rasheed@gmail.com> Backpatch-through: 15
Files
| Path | Change | +/− |
|---|---|---|
| src/backend/executor/nodeModifyTable.c | modified | +5 −0 |
| src/test/isolation/expected/merge-update.out | modified | +25 −0 |
| src/test/isolation/specs/merge-update.spec | modified | +2 −0 |
Discussion
- MERGE behavior with REPEATABLE READ isolation level 7 messages · 2026-02-15 → 2026-03-01