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: pg_createsubscriber: Fix duplicate publication name rejection.
Date: Mon, 08 Jun 2026 06:56:37 +0000
Message-ID: <E1wWTuX-001YnU-0W@gemulon.postgresql.org> (raw)

pg_createsubscriber: Fix duplicate publication name rejection.

pg_createsubscriber rejected duplicate --publication values while parsing
command-line options, even when the duplicate names referred to
publications in different databases. Since publication names are
database-local objects, the same name is perfectly valid across multiple
databases.

This restriction was not a practical problem before commit 85ddcc2f4c,
which added support for reusing pre-existing publications. After that
change, users who have identically-named publications in multiple
databases (a common convention) could not use the feature without renaming
their publications.

The analogous restriction on --subscription names is intentionally kept as
they are reused as replication slot names, which are cluster-global, so
allowing duplicate subscription names without additional guards could
cause a slot-name collision. That work is left for a future release.

Author: Chao Li <li.evan.chao@gmail.com>
Reviewed-by: Shlok Kyal <shlok.kyal.oss@gmail.com>
Reviewed-by: Amit Kapila <amit.kapila16@gmail.com>
Reviewed-by: Hayato Kuroda <kuroda.hayato@fujitsu.com>
Discussion: https://postgr.es/m/B08A7C89-B3DE-4C1D-A671-32AD8BAB7E22@gmail.com

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/6ce035ffff444479e63ea6276d56e33cc8b991d9

Modified Files
--------------
src/bin/pg_basebackup/pg_createsubscriber.c        |  9 ++-------
src/bin/pg_basebackup/t/040_pg_createsubscriber.pl | 19 ++++---------------
2 files changed, 6 insertions(+), 22 deletions(-)



Message-ID: <E1wWTuX-001YnU-0W@gemulon.postgresql.org>
Permalink:  ../E1wWTuX-001YnU-0W@gemulon.postgresql.org/
Also on:    postgresql.org/message-id/E1wWTuX-001YnU-0W@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: pg_createsubscriber: Fix duplicate publication name rejection.
  In-Reply-To: <E1wWTuX-001YnU-0W@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