pg_createsubscriber: allow duplicate subscription names

From: Chao Li <li(dot)evan(dot)chao(at)gmail(dot)com>
To: PostgreSQL Hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Cc: Amit Kapila <amit(dot)kapila16(at)gmail(dot)com>, "Hayato Kuroda (Fujitsu)" <kuroda(dot)hayato(at)fujitsu(dot)com>
Subject: pg_createsubscriber: allow duplicate subscription names
Date: 2026-08-05 07:29:17
Message-ID: 2B037930-9B7F-41D3-98B3-E50FFD94C01A@gmail.com
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hi,

This is follow-up work to patch [1], which fixed a bug in PG19 by allowing pg_createsubscriber to accept duplicate publication names, since publication names are unique per database.

In the review thread, Amit suggested allowing duplicate subscription names as well, because subscription names are also unique per database. However, that required more work because when slot names are not specified, subscription names are used as slot names, and slot names must be unique per cluster. For that reason, the change was deferred to v20.

Here it is. The code changes are actually small. When slot names are specified, we can allow duplicate subscription names. Doc and test changes are included. See the attached patch for details.

[1] https://www.postgresql.org/message-id/B08A7C89-B3DE-4C1D-A671-32AD8BAB7E22%40gmail.com

Best regards,
--
Chao Li (Evan)
HighGo Software Co., Ltd.
https://www.highgo.com/

Attachment Content-Type Size
v1-0001-pg_createsubscriber-Allow-duplicate-subscription-.patch application/octet-stream 5.4 KB

Browse pgsql-hackers by date

  From Date Subject
Next Message Ilia Evdokimov 2026-08-05 07:33:14 Re: Fix var_eq_const: sum selectivity of all matching MCV entries instead of stopping at first match
Previous Message Chao Li 2026-08-05 06:28:24 Re: Reduce memory overheads for storing a Memoize tuple