agora inbox for pgsql-committers@postgresql.org  
help / color / mirror / Atom feed
From: Amit Kapila <akapila@postgresql.org>
To: pgsql-committers@lists.postgresql.org
Subject: pgsql: Fix publisher retain_dead_tuples check when also changing origin
Date: Mon, 08 Jun 2026 05:37:23 +0000
Message-ID: <E1wWSfr-001YB7-38@gemulon.postgresql.org> (raw)

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@gmail.com>
Reviewed-by: Zhijie Hou <houzj.fnst@fujitsu.com>
Reviewed-by: Amit Kapila <amit.kapila16@gmail.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(-)



Message-ID: <E1wWSfr-001YB7-38@gemulon.postgresql.org>
Permalink:  ../E1wWSfr-001YB7-38@gemulon.postgresql.org/
Also on:    postgresql.org/message-id/E1wWSfr-001YB7-38@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: akapila@postgresql.org, pgsql-committers@lists.postgresql.org
  Subject: Re: pgsql: Fix publisher retain_dead_tuples check when also changing origin
  In-Reply-To: <E1wWSfr-001YB7-38@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 agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox