diff --git a/src/backend/commands/subscriptioncmds.c b/src/backend/commands/subscriptioncmds.c index 21ef15f..95c34fe 100644 --- a/src/backend/commands/subscriptioncmds.c +++ b/src/backend/commands/subscriptioncmds.c @@ -291,6 +291,11 @@ CreateSubscription(CreateSubscriptionStmt *stmt, bool isTopLevel) bool create_slot; List *publications; + if (!IsUnderPostmaster) + ereport(FATAL, + (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("subscription commands are not supported by single-user servers"))); + /* * Parse and check options. * Connection and publication should not be specified here. @@ -583,6 +588,12 @@ AlterSubscription(AlterSubscriptionStmt *stmt) bool update_tuple = false; Subscription *sub; + if (!IsUnderPostmaster) + ereport(FATAL, + (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("subscription commands are not supported by single-user servers"))); + + rel = heap_open(SubscriptionRelationId, RowExclusiveLock); /* Fetch the existing tuple. */ @@ -780,6 +791,11 @@ DropSubscription(DropSubscriptionStmt *stmt, bool isTopLevel) WalReceiverConn *wrconn = NULL; StringInfoData cmd; + if (!IsUnderPostmaster) + ereport(FATAL, + (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("subscription commands are not supported by single-user servers"))); + /* * Lock pg_subscription with AccessExclusiveLock to ensure * that the launcher doesn't restart new worker during dropping