Re: Error while creating subscription when server is running in single user mode

From: Michael Paquier <michael(dot)paquier(at)gmail(dot)com>
To: Dilip Kumar <dilipbalaut(at)gmail(dot)com>
Cc: tushar <tushar(dot)ahuja(at)enterprisedb(dot)com>, PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Error while creating subscription when server is running in single user mode
Date: 2017-06-01 07:32:45
Message-ID: CAB7nPqQ10ZgJqh_ByUWFhgHpKMQj55=r=c9Z5PLE0Ehd249C5A@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Wed, May 31, 2017 at 10:49 PM, Dilip Kumar <dilipbalaut(at)gmail(dot)com> wrote:
> On Wed, May 31, 2017 at 2:20 PM, Michael Paquier
> <michael(dot)paquier(at)gmail(dot)com> wrote:
>> Yeah, see 0e0f43d6 for example. A simple fix is to look at
>> IsUnderPostmaster when creating, altering or dropping a subscription
>> in subscriptioncmds.c.
>
> Yeah, below patch fixes that.

Thanks, this looks correct to me at quick glance.

+ if (!IsUnderPostmaster)
+ ereport(FATAL,
+ (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("subscription commands are not supported by
single-user servers")));
The messages could be more detailed, like directly the operation of
CREATE/ALTER/DROP SUBCRIPTION in each error message. But that's a nit.
--
Michael

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Michael Paquier 2017-06-01 07:36:03 Re: TAP: allow overriding PostgresNode in get_new_node
Previous Message wangchuanting 2017-06-01 07:11:08 Re: BUG #14680: startup process on standby encounter a deadlock of TwoPhaseStateLock when redo 2PC xlog