pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Amit Kapila <akapila@postgresql.org>
To: pgsql-committers@lists.postgresql.org
Subject: pgsql: Skip relations dropped concurrently in GetSubscriptionRelations(
Date: Wed, 26 Aug 2026 09:24:04 +0000
Message-ID: <E1wz9rX-00000002B0T-2O8i@gemulon.postgresql.org> (raw)

Skip relations dropped concurrently in GetSubscriptionRelations().

GetSubscriptionRelations() can see a pg_subscription_rel row for a
relation whose pg_class row was removed by a concurrent DROP. In this
case, get_rel_relkind() returns '\0'. Skip such relations since they no
longer exist and do not need synchronization.

Replace the assertion on relkind with an error. Once the dropped
relation case is handled, any other unexpected relkind indicates a
relation kind that cannot be part of a subscription and should be
reported rather than ignored.

Author: Vignesh C <vignesh21@gmail.com>
Reviewed-by: Amit Kapila <amit.kapila16@gmail.com>
Reviewed-by: Bharath Rupireddy <bharath.rupireddyforpostgres@gmail.com>
Reviewed-by: Hayato Kuroda <kuroda.hayato@fujitsu.com>
Reviewed-by: Kyotaro Horiguchi <horikyota.ntt@gmail.com>
Backpatch-through: 19
Discussion: https://postgr.es/m/CALDaNm3eeKocRtQyUPdg2kaxJ-VAo5pwcNytDKNT1Yc0t2V_ug%40mail.gmail.com

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/05f37b2b5eac5feab774a990a64ad16e2d03f5f5

Modified Files
--------------
src/backend/catalog/pg_subscription.c | 31 ++++++++++++++++++++++---------
1 file changed, 22 insertions(+), 9 deletions(-)



view thread (2+ messages)  latest in thread

Message-ID: <E1wz9rX-00000002B0T-2O8i@gemulon.postgresql.org>
Permalink:  ../E1wz9rX-00000002B0T-2O8i@gemulon.postgresql.org/
Also on:    postgresql.org/message-id/E1wz9rX-00000002B0T-2O8i@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: Skip relations dropped concurrently in GetSubscriptionRelations(
  In-Reply-To: <E1wz9rX-00000002B0T-2O8i@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