diff --git a/doc/src/sgml/ref/drop_subscription.sgml b/doc/src/sgml/ref/drop_subscription.sgml index adbdeafb4e..65b025c6a6 100644 --- a/doc/src/sgml/ref/drop_subscription.sgml +++ b/doc/src/sgml/ref/drop_subscription.sgml @@ -84,9 +84,11 @@ DROP SUBSCRIPTION [ IF EXISTS ] nameDROP SUBSCRIPTION command will fail. To proceed in - this situation, disassociate the subscription from the replication slot by - executing ALTER SUBSCRIPTION ... SET (slot_name = NONE). + the DROP SUBSCRIPTION command will fail. To proceed + in this situation, first disable the subscription by executing + ALTER SUBSCRIPTION ... DISABLE, and then disassociate + it from the replication slot by executing + ALTER SUBSCRIPTION ... SET (slot_name = NONE). After that, DROP SUBSCRIPTION will no longer attempt any actions on a remote host. Note that if the remote replication slot still exists, it should then be dropped manually; otherwise it will continue to diff --git a/src/backend/commands/subscriptioncmds.c b/src/backend/commands/subscriptioncmds.c index 7c981212e7..b03a9871ca 100644 --- a/src/backend/commands/subscriptioncmds.c +++ b/src/backend/commands/subscriptioncmds.c @@ -975,8 +975,10 @@ DropSubscription(DropSubscriptionStmt *stmt, bool isTopLevel) (errmsg("could not connect to publisher when attempting to " "drop the replication slot \"%s\"", slotname), errdetail("The error was: %s", err), - errhint("Use ALTER SUBSCRIPTION ... SET (slot_name = NONE) " - "to disassociate the subscription from the slot."))); + /* translator: %s is an SQL ALTER command */ + errhint("Use %s to disable the subscription, and then use %s to disassociate it from the slot.", + "ALTER SUBSCRIPTION ... DISABLE", + "ALTER SUBSCRIPTION ... SET (slot_name = NONE)"))); PG_TRY(); {