Re: pg_dump writes a subscription's default slot name, which can't be restored

From: Zsolt Parragi <zsolt(dot)parragi(at)percona(dot)com>
To: Baji Shaik <baji(dot)pgdev(at)gmail(dot)com>
Cc: pgsql-hackers(at)lists(dot)postgresql(dot)org, Masahiko Sawada <sawada(dot)mshk(at)gmail(dot)com>
Subject: Re: pg_dump writes a subscription's default slot name, which can't be restored
Date: 2026-12-03 23:55:47
Message-ID: CAN4CZFNU5vfAakqHuVNzNDU9P3JFt_SqUTWnVKAsL48mKLvbfg@mail.gmail.com
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hello

1. CREATE SUBSCRIPTION none CONNECTION '...' PUBLICATION p WITH
(connect = false);

This is a not-so realistic corner case, but for this case restore
still doesn't work even with the patch.

2.

+-- fail - the default slot name (the subscription name) must be a
valid slot name
+CREATE SUBSCRIPTION "Regress_TestSub" CONNECTION
'dbname=regress_doesnotexist' PUBLICATION testpub WITH (connect =
false);

This can fail with:

+WARNING: subscriptions created by regression test cases should have
names starting with "regress_"

3.

+-- fail - the default slot name (the subscription name) must be a
valid slot name
+CREATE SUBSCRIPTION "Regress_TestSub" CONNECTION
'dbname=regress_doesnotexist' PUBLICATION testpub WITH (connect =
false);
+ERROR: replication slot name "Regress_TestSub" contains invalid character
+HINT: Replication slot names may only contain lower case letters,
numbers, and the underscore character.

Another nitpick: the CREATE SUBSCRIPTION / the user didn't specify any
slot name. Maybe this could have a detail explaining that? 'The
subscription name is used as the replication slot name when slot_name
is not specified' or something like that.

4. Should the documentation be also updated to mention this?

In response to

Browse pgsql-hackers by date

  From Date Subject
Previous Message Zsolt Parragi 2026-12-03 23:45:17 Re: [PATCH] pageinspect: validate line pointers before using them