summaryrefslogtreecommitdiff
path: root/src/backend/commands/subscriptioncmds.c
diff options
context:
space:
mode:
authorAmit Kapila <akapila@postgresql.org>2021-07-19 08:32:37 +0530
committerAmit Kapila <akapila@postgresql.org>2021-07-19 08:32:37 +0530
commitdcecdfafbd2dbdfaa0f82e7710abfa65242a1d1e (patch)
tree045033d0e8c29c6e4f924fa0df72807a177c472c /src/backend/commands/subscriptioncmds.c
parent2dbe8905711ba09a2214b6e835f8f0c2c4981cb3 (diff)
downloadpostgresql-dcecdfafbd2dbdfaa0f82e7710abfa65242a1d1e.tar.gz
Update comments for AlterSubscription.
Add explanation as to why the subscription needs to be disabled to allow slot_name as none. Author: Japin Li and Amit Kapila Discussion: https://postgr.es/m/MEYP282MB1669CBD98E721C77CA696499B61A9@MEYP282MB1669.AUSP282.PROD.OUTLOOK.COM
Diffstat (limited to 'src/backend/commands/subscriptioncmds.c')
-rw-r--r--src/backend/commands/subscriptioncmds.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/backend/commands/subscriptioncmds.c b/src/backend/commands/subscriptioncmds.c
index 239d263f83..cc4c1b47e4 100644
--- a/src/backend/commands/subscriptioncmds.c
+++ b/src/backend/commands/subscriptioncmds.c
@@ -894,6 +894,13 @@ AlterSubscription(ParseState *pstate, AlterSubscriptionStmt *stmt,
if (IsSet(opts.specified_opts, SUBOPT_SLOT_NAME))
{
+ /*
+ * The subscription must be disabled to allow slot_name as
+ * 'none', otherwise, the apply worker will repeatedly try
+ * to stream the data using that slot_name which neither
+ * exists on the publisher nor the user will be allowed to
+ * create it.
+ */
if (sub->enabled && !opts.slot_name)
ereport(ERROR,
(errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),