> On Dec 4, 2026, at 09:56, Baji Shaik <[email protected]> wrote:
> 
> Hello Zsolt,
> 
> On Thu, Dec 3, 2026 at 5:55 PM Zsolt Parragi <[email protected]> 
> wrote:
> 
> Thank you so much for review and feedback.
>   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.
> 
> Right, and it doesn't even fail. v2 rejects "none" as the default slot name 
> too.  
> 2.
> 
> +WARNING:  subscriptions created by regression test cases should have
> names starting with "regress_"
> 
> Renamed it to "regress_TestSub", and the reserved name and "none"
> tests now run with client_min_messages = ERROR.
>   
> 3.
> 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?
> 
> Added the DETAIL and updated the slot_name description in 
> CREATE SUBSCRIPTION. 
> Thanks,
> Baji Shaik
> <v2-0001-Validate-the-default-slot-name-in-CREATE-SUBSCRIP.patch>

I think the initial patch was trying to handle existing invalid slot names, 
while with Masahiko-san’s suggestion, it switched direction to block future 
invalid slot names. So, if a database already contains an invalid slot name, 
such as “MySub”, pg_restore will still fail, and pg_upgrade will still fail.

Maybe we can add a check to “pg_upgrade --check”, so that users can detect the 
error earlier and fix it before an actual upgrade. But I have no idea how we 
can improve pg_restore to handle existing invalid slot names.

WRT v2, I don’t think we should block “none”, because doing so will lead to 
inconsistent behaviors:
```
evantest=# CREATE SUBSCRIPTION none CONNECTION 'dbname=postgres' PUBLICATION p 
WITH (connect = false);
ERROR:  replication slot name "none" cannot be used
DETAIL:  The subscription name is used as the replication slot name when 
slot_name is not specified.
HINT:  Specify a different slot_name for the subscription.
evantest=#
evantest=#
evantest=# CREATE SUBSCRIPTION none CONNECTION 'dbname=postgres' PUBLICATION p 
WITH (connect = false, slot_name='none');
WARNING:  subscription was created, but is not connected
HINT:  To initiate replication, you must manually create the replication slot, 
enable the subscription, and alter the subscription to refresh publications.
CREATE SUBSCRIPTION
```

With v2, the first CREATE SUBSCRIPTION fails, but the second still succeeds 
with NULL stored in subslotname, which seems inconsistent. Normally, when the 
subscription name is a valid slot name, explicitly specifying the subscription 
name as slot_name should behave the same way as omitting slot_name. IMO, the 
first should also succeed and behave the same way as the second.

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






Reply via email to