From 50d78a60142522f9a38b540d737b7e92d928d8bf Mon Sep 17 00:00:00 2001 From: Peter Smith Date: Tue, 20 Jun 2023 11:22:30 +1000 Subject: [PATCH] logical_replication_slot_disable_doc_update_v5_REL_14 --- doc/src/sgml/ref/drop_subscription.sgml | 8 +++++--- src/backend/commands/subscriptioncmds.c | 3 ++- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/doc/src/sgml/ref/drop_subscription.sgml b/doc/src/sgml/ref/drop_subscription.sgml index aee9615..d79f137 100644 --- a/doc/src/sgml/ref/drop_subscription.sgml +++ b/doc/src/sgml/ref/drop_subscription.sgml @@ -85,9 +85,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 (and any related table synchronization slots) should then be diff --git a/src/backend/commands/subscriptioncmds.c b/src/backend/commands/subscriptioncmds.c index 1719f04..b1a2f3f 100644 --- a/src/backend/commands/subscriptioncmds.c +++ b/src/backend/commands/subscriptioncmds.c @@ -1578,7 +1578,8 @@ ReportSlotConnectionError(List *rstates, Oid subid, char *slotname, char *err) errmsg("could not connect to publisher when attempting to " "drop replication slot \"%s\": %s", slotname, err), /* translator: %s is an SQL ALTER command */ - errhint("Use %s to disassociate the subscription from the slot.", + 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)"))); } -- 1.8.3.1