]> git.ipfire.org Git - thirdparty/postgresql.git/commit
Fix replica identity check for MERGE.
authorDean Rasheed <dean.a.rasheed@gmail.com>
Thu, 4 Sep 2025 10:48:51 +0000 (11:48 +0100)
committerDean Rasheed <dean.a.rasheed@gmail.com>
Thu, 4 Sep 2025 10:48:51 +0000 (11:48 +0100)
commit421d7a1579853220dfc650126bd43718acdae84b
tree0066ed018d59661ad66857f7f899c0e8c691a9e2
parent0c4d5a45dbd7d11c9ddff4f7cf4dae3940b083be
Fix replica identity check for MERGE.

When executing a MERGE, check that the target relation supports all
actions mentioned in the MERGE command. Specifically, check that it
has a REPLICA IDENTITY if it publishes updates or deletes and the
MERGE command contains update or delete actions. Failing to do this
can silently break replication.

Author: Zhijie Hou <houzj.fnst@fujitsu.com>
Reviewed-by: Ashutosh Bapat <ashutosh.bapat.oss@gmail.com>
Reviewed-by: Dean Rasheed <dean.a.rasheed@gmail.com>
Tested-by: Chao Li <li.evan.chao@gmail.com>
Discussion: https://postgr.es/m/OS3PR01MB57180C87E43A679A730482DF94B62@OS3PR01MB5718.jpnprd01.prod.outlook.com
Backpatch-through: 15
src/backend/executor/execMain.c
src/backend/executor/execPartition.c
src/backend/executor/nodeModifyTable.c
src/include/executor/executor.h
src/test/regress/expected/publication.out
src/test/regress/sql/publication.sql