RE: pg_createsubscriber: allow duplicate publication names

Hayato Kuroda (Fujitsu) <kuroda.hayato@fujitsu.com>

From: "Hayato Kuroda (Fujitsu)" <kuroda.hayato@fujitsu.com>
To: 'Amit Kapila' <amit.kapila16@gmail.com>, Chao Li <li.evan.chao@gmail.com>
Cc: PostgreSQL-development <pgsql-hackers@postgresql.org>, Shubham Khanna <khannashubham1197@gmail.com>
Date: 2026-06-02T10:01:07Z
Lists: pgsql-hackers
Dear Amit,

> Can't we use --replication-slot=name to avoid this ERROR? I mean use
> different replication slot names.

Are you saying the below case, right? It can work.

```
$ pg_createsubscriber -D data_sta/ -P 'user=postgres port=5432' -d postgres --subscription sub --replication-slot=slot1 -d testdb --subscription sub --replication-slot=slot2 -U postgres
```

BTW; slot creations are tried before the standby promotes, thus there may be a chance
user read the error message, change the subscription name, and retry. But I still
think we should guard the combination, which means it's too late for PG19.

Best regards,
Hayato Kuroda
FUJITSU LIMITED

Commits

  1. pg_createsubscriber: Fix duplicate publication name rejection.