On Fri, Sep 11, 2026 at 3:13 PM vignesh C <[email protected]> wrote:
>
> On Fri, 11 Sept 2026 at 13:57, Peter Smith <[email protected]> wrote:
> >
> > I don't really see what is gained by splitting those error messages,
> > since the user will get an indeterminate one, and either way they have
> > to fix it
> >
> > IMO, a single unified message could be a simpler/better choice here:
> >
> > e.g.
> >
> > ereport(ERROR,
> >     (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
> >     errmsg("cannot change table \"%s\" to unlogged because it is
> > referenced by a publication",
> >         RelationGetRelationName(rel)),
> >     errdetail("Unlogged relations cannot be published or excluded via
> > an EXCEPT clause."),
> >     errhint("Remove the table from the publication first.")));
>
> I agree with this approach. A single unified error message is better,
> especially since the user needs to remove the table from the
> publication either way.
>

I am fine with the single message but how about changing the HINT to:
"Drop the table from the publication, or remove it from the
publication's EXCEPT clause, first." because the proposed message is
not suitable for the EXCEPT case.

-- 
With Regards,
Amit Kapila.


Reply via email to