pgsql: Fix replica identity check for MERGE. - Mailing list pgsql-committers

From Dean Rasheed
Subject pgsql: Fix replica identity check for MERGE.
Date
Msg-id E1uu7bC-000S0A-2A@gemulon.postgresql.org
Whole thread Raw
List pgsql-committers
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

Branch
------
REL_18_STABLE

Details
-------
https://git.postgresql.org/pg/commitdiff/311340f17863b0f87b3af32649ee5a2a58988b08

Modified Files
--------------
src/backend/executor/execMain.c           | 11 ++++++++++-
src/test/regress/expected/publication.out | 28 ++++++++++++++++++++++++++++
src/test/regress/sql/publication.sql      | 31 +++++++++++++++++++++++++++++++
3 files changed, 69 insertions(+), 1 deletion(-)


pgsql-committers by date:

Previous
From: Dean Rasheed
Date:
Subject: pgsql: Fix replica identity check for INSERT ON CONFLICT DO UPDATE.
Next
From: Dean Rasheed
Date:
Subject: pgsql: Fix compiler error introduced by 5386bfb9c1f.