diff --git a/src/backend/commands/subscriptioncmds.c b/src/backend/commands/subscriptioncmds.c index 8ecb6e0bb87..c3d541b59d8 100644 --- a/src/backend/commands/subscriptioncmds.c +++ b/src/backend/commands/subscriptioncmds.c @@ -1809,7 +1809,17 @@ DropSubscription(DropSubscriptionStmt *stmt, bool isTopLevel) ReplicationSlotNameForTablesync(subid, relid, syncslotname, sizeof(syncslotname)); - ReplicationSlotDropAtPubNode(wrconn, syncslotname, true); + + if (disable_logical_replication_subscribers) + { + ereport(LOG, + (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("skip dropping tablesync slot \"%s\" when disable_logical_replication_subscribers=true", syncslotname))); + } + else + { + ReplicationSlotDropAtPubNode(wrconn, syncslotname, true); + } } }