]> git.ipfire.org Git - thirdparty/postgresql.git/commit
Fix handling of updated tuples in the MERGE statement
authorAlexander Korotkov <akorotkov@postgresql.org>
Thu, 5 Mar 2026 17:47:20 +0000 (19:47 +0200)
committerAlexander Korotkov <akorotkov@postgresql.org>
Thu, 5 Mar 2026 18:02:08 +0000 (20:02 +0200)
commitf6e63d4b8b2ec5ff011c87f79f3efc8abe921263
tree5b51f4ff3340e80d8127cfde998acc2814969cc4
parentf51821d9cf769d3f8f400dcef9f46ecd584e1403
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
src/backend/executor/nodeModifyTable.c
src/test/isolation/expected/merge-update.out
src/test/isolation/specs/merge-update.spec