From 013c1178fd0adefa0f68d5ce2d84e7ae6f9613a1 Mon Sep 17 00:00:00 2001 From: Peter Eisentraut Date: Tue, 9 May 2017 10:20:42 -0400 Subject: Remove the NODROP SLOT option from DROP SUBSCRIPTION It turned out this approach had problems, because a DROP command should not have any options other than CASCADE and RESTRICT. Instead, always attempt to drop the slot if there is one configured, but also add an ALTER SUBSCRIPTION action to set the slot to NONE. Author: Petr Jelinek Reported-by: Tom Lane Discussion: https://www.postgresql.org/message-id/29431.1493730652@sss.pgh.pa.us --- doc/src/sgml/ref/create_subscription.sgml | 9 +++++++++ doc/src/sgml/ref/drop_subscription.sgml | 23 +++++++++-------------- 2 files changed, 18 insertions(+), 14 deletions(-) (limited to 'doc/src') diff --git a/doc/src/sgml/ref/create_subscription.sgml b/doc/src/sgml/ref/create_subscription.sgml index 3c51012df8b..63824684031 100644 --- a/doc/src/sgml/ref/create_subscription.sgml +++ b/doc/src/sgml/ref/create_subscription.sgml @@ -133,6 +133,15 @@ CREATE SUBSCRIPTION subscription_namesubscription_name for slot name. + + + When SLOT NAME is set to + NONE, there will be no replication slot associated + with the subscription. This can be used if the replication slot will be + created later manually. Such subscriptions must also have both + ENABLED and CREATE SLOT set + to false. + diff --git a/doc/src/sgml/ref/drop_subscription.sgml b/doc/src/sgml/ref/drop_subscription.sgml index f1ac1250577..4f34a35eefe 100644 --- a/doc/src/sgml/ref/drop_subscription.sgml +++ b/doc/src/sgml/ref/drop_subscription.sgml @@ -21,7 +21,7 @@ PostgreSQL documentation -DROP SUBSCRIPTION [ IF EXISTS ] name [ DROP SLOT | NODROP SLOT ] +DROP SUBSCRIPTION [ IF EXISTS ] name [ CASCADE | RESTRICT ] @@ -39,7 +39,9 @@ DROP SUBSCRIPTION [ IF EXISTS ] name DROP SUBSCRIPTION cannot be executed inside a - transaction block when DROP SLOT is specified. + transaction block if the subscription is associated with a replication + slot. (You can use ALTER SUBSCRIPTION to unset the + slot.) @@ -57,20 +59,13 @@ DROP SUBSCRIPTION [ IF EXISTS ] name - DROP SLOT - NODROP SLOT - - - Specifies whether to drop the replication slot on the publisher. The - default is - DROP SLOT. - + CASCADE + RESTRICT + - If the publisher is not reachable when the subscription is to be - dropped, then it is useful to specify NODROP SLOT. - But the replication slot on the publisher will then have to be removed - manually. + These key words do not have any effect, since there are no dependencies + on subscriptions. -- cgit v1.2.3