pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Dean Rasheed <dean.a.rasheed@gmail.com>
To: pgsql-committers@lists.postgresql.org
Subject: pgsql: Fix replica identity check for MERGE.
Date: Thu, 04 Sep 2025 10:53:50 +0000
Message-ID: <E1uu7bC-000S08-26@gemulon.postgresql.org> (raw)

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
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/fc6600fc1cd13b695fbde4b5f3ff0d2e97c36dea

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(-)



view thread (5+ messages)  latest in thread

Message-ID: <E1uu7bC-000S08-26@gemulon.postgresql.org>
Permalink:  ../E1uu7bC-000S08-26@gemulon.postgresql.org/
Also on:    postgresql.org/message-id/E1uu7bC-000S08-26@gemulon.postgresql.org

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-committers@postgresql.org
  Cc: dean.a.rasheed@gmail.com, pgsql-committers@lists.postgresql.org
  Subject: Re: pgsql: Fix replica identity check for MERGE.
  In-Reply-To: <E1uu7bC-000S08-26@gemulon.postgresql.org>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox