Re: alter subscription drop publication fixes

From: Dilip Kumar <dilipbalaut(at)gmail(dot)com>
To: Bharath Rupireddy <bharath(dot)rupireddyforpostgres(at)gmail(dot)com>
Cc: Japin Li <japinli(at)hotmail(dot)com>, vignesh C <vignesh21(at)gmail(dot)com>, PostgreSQL Hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Subject: Re: alter subscription drop publication fixes
Date: 2021-05-13 05:34:34
Message-ID: CAFiTN-t5-sGQMf+qU+0pXhy2r2Wv3mxM9auSz5pVayFEiy6j9A@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Thu, May 13, 2021 at 9:36 AM Bharath Rupireddy
<bharath(dot)rupireddyforpostgres(at)gmail(dot)com> wrote:
>
> On Thu, May 13, 2021 at 8:45 AM Japin Li <japinli(at)hotmail(dot)com> wrote:
> > >> Dropping all the publications present in the subscription using alter
> > >> subscription drop publication would throw "subscription must contain
> > >> at least one publication". This message was slightly confusing to me.
> > >> As even though some publication was present on the subscription I was
> > >> not able to drop. Instead I feel we could throw an error message
> > >> something like "dropping specified publication will result in
> > >> subscription without any publication, this is not supported".
> > >
> > > -1 for that long message. The intention of that error was to throw an
> > > error if all the publications of a subscription are dropped. If that's
> > > so confusing, then you could just let the error message be
> > > "subscription must contain at least one publication", add an error
> > > detail "Subscription without any publication is not allowed to
> > > exist/is not supported." or "Removing/Dropping all the publications
> > > from a subscription is not allowed/supported." or some other better
> > > wording.
> > >
> >
> > Agree with Bharath. We can use a detail message. How about?
> >
> > if (!oldpublist)
> > ereport(ERROR,
> > (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
> > errmsg("subscription must contain at least one publication"),
> > errdetail("Dropping all the publications from a subscription is not supported")));
>
> Or how about just errmsg("cannot drop all the publications of the
> subscriber \"%s\"", subname) without any error detail?

IMHO, this message without errdetail looks much better.

--
Regards,
Dilip Kumar
EnterpriseDB: http://www.enterprisedb.com

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message osumi.takamichi@fujitsu.com 2021-05-13 05:45:16 RE: Forget close an open relation in ReorderBufferProcessTXN()
Previous Message Maciek Sakrejda 2021-05-13 05:31:01 Re: compute_query_id and pg_stat_statements