pgsql: Fix publisher retain_dead_tuples check when also changing origin

From: Amit Kapila <akapila(at)postgresql(dot)org>
To: pgsql-committers(at)lists(dot)postgresql(dot)org
Subject: pgsql: Fix publisher retain_dead_tuples check when also changing origin
Date: 2026-06-08 05:37:23
Message-ID: E1wWSfr-001YB7-38@gemulon.postgresql.org
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-committers

Fix publisher retain_dead_tuples check when also changing origin.

In AlterSubscription(), when the SET clause includes both
retain_dead_tuples and origin options, the origin branch was using
assignment (=) rather than bitwise-or assignment (|=) when setting
check_pub_rdt. This meant that if retain_dead_tuples had already set the
flag to true in the same command, the origin branch would silently
overwrite it. As a result, the publisher-side retain_dead_tuples check
could be incorrectly skipped.

Fix by changing the assignment to |= so that the flag accumulates across
both option branches within the same ALTER SUBSCRIPTION command.

Author: SATYANARAYANA NARLAPURAM <satyanarlapuram(at)gmail(dot)com>
Reviewed-by: Zhijie Hou <houzj(dot)fnst(at)fujitsu(dot)com>
Reviewed-by: Amit Kapila <amit(dot)kapila16(at)gmail(dot)com>
Discussion: https://postgr.es/m/CAHg+QDfe7WPOhVGKzv83ZB+BmXM88r=KPQn1sa_ZXMMChcNo=A@mail.gmail.com

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/75dcc63dac0ef183774ec22a6557174ee36db601

Modified Files
--------------
src/backend/commands/subscriptioncmds.c | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)

Browse pgsql-committers by date

  From Date Subject
Next Message Michael Paquier 2026-06-08 05:40:37 pgsql: psql: Fix expanded aligned output
Previous Message Bruce Momjian 2026-06-08 03:27:49 pgsql: doc PG 19 relnotes: improve awkward or confusing wording