Re: A doubt about a newly added errdetail - Mailing list pgsql-hackers

From Amit Kapila
Subject Re: A doubt about a newly added errdetail
Date
Msg-id CAA4eK1LW+wHmNhMPmGydGXOejB_EKrqcQVoDLDPD0kUB51AAaA@mail.gmail.com
Whole thread Raw
In response to Re: A doubt about a newly added errdetail  (Kyotaro Horiguchi <horikyota.ntt@gmail.com>)
Responses Re: A doubt about a newly added errdetail
List pgsql-hackers
On Wed, Sep 28, 2022 at 11:30 AM Kyotaro Horiguchi
<horikyota.ntt@gmail.com> wrote:
>
> At Tue, 27 Sep 2022 12:19:35 +0200, Alvaro Herrera <alvherre@alvh.no-ip.org> wrote in
> > Yeah, since you're changing another word in that line, it's ok to move
> > the parameter line off-string.  (If you were only changing the parameter
> > to %s and there was no message duplication, I would reject the patch as
> > useless.)
>
> I'm fine with that. By the way, related to the area, I found the
> following error messages.
>
> >        errmsg("publication \"%s\" is defined as FOR ALL TABLES",
> >                       NameStr(pubform->pubname)),
> >        errdetail("Schemas cannot be added to or dropped from FOR ALL TABLES publications.")));
>
> It looks tome that the errmsg and errordetail are reversed. Isn't the following order common?
>
> >        errmsg("schemas cannot be added to or dropped from publication \"%s\".",
> >                       NameStr(pubform->pubname)),
> >        errdetail("The publication is defined as FOR ALL TABLES.")));
>

This one seems to be matching with the below existing message:
ereport(ERROR,
(errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
errmsg("publication \"%s\" is defined as FOR ALL TABLES",
NameStr(pubform->pubname)),
errdetail("Tables cannot be added to or dropped from FOR ALL TABLES
publications.")));


-- 
With Regards,
Amit Kapila.



pgsql-hackers by date:

Previous
From: Polina Bungina
Date:
Subject: Re: pg_rewind WAL segments deletion pitfall
Next
From: Kyotaro Horiguchi
Date:
Subject: Re: In-placre persistance change of a relation