Re: A doubt about a newly added errdetail

From: Amit Kapila <amit(dot)kapila16(at)gmail(dot)com>
To: Alvaro Herrera <alvherre(at)alvh(dot)no-ip(dot)org>
Cc: Kyotaro Horiguchi <horikyota(dot)ntt(at)gmail(dot)com>, pgsql-hackers(at)lists(dot)postgresql(dot)org
Subject: Re: A doubt about a newly added errdetail
Date: 2022-09-26 08:01:29
Message-ID: CAA4eK1LR_7EWkdF+KNDDsm4SgAzbyC_eyRSypwXZjx9t5kfVEQ@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Mon, Sep 26, 2022 at 1:10 PM Alvaro Herrera <alvherre(at)alvh(dot)no-ip(dot)org> wrote:
>
> On 2022-Sep-26, Kyotaro Horiguchi wrote:
>
> > I saw the following message recently added to publicationcmds.c.
> >
> > (ERROR: cannot use publication column list for relation "%s.%s"")
> > > DETAIL: Column list cannot be specified if any schema is part of the publication or specified in the list.
> >
> > As my reading, the "the list" at the end syntactically means "Column
> > list" but that is actually wrong; it could be read as "the list
> > following TABLES IN" but that doesn't seem reasonable.
> >
> > If I am right, it might should be something like the following:
> >
> > + Column list cannot be specified if any schema is part of the publication or specified in the command.
> > + Column list cannot be specified if any schema is part of the publication or specified together.
>
> I propose
>
> ERROR: cannot use column list for relation "%s.%s" in publication "%s"
> DETAIL: Column lists cannot be specified in publications containing FOR TABLES IN SCHEMA elements.
>

This looks mostly good to me. BTW, is it a good idea to add ".. in
publication "%s"" to the error message as this can happen even during
create publication? If so, I think we can change the nearby message as
below to include the same:

if (!pubviaroot &&
pri->relation->rd_rel->relkind == RELKIND_PARTITIONED_TABLE)
ereport(ERROR,
(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
errmsg("cannot use publication column list for relation \"%s\"",

I think even if we don't include the publication name, there won't be
any confusion because there won't be multiple publications in the
command.

--
With Regards,
Amit Kapila.

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Kyotaro Horiguchi 2022-09-26 08:10:16 Re: Refactor backup related code (was: Is it correct to say, "invalid data in file \"%s\"", BACKUP_LABEL_FILE in do_pg_backup_stop?)
Previous Message Michael Paquier 2022-09-26 08:00:56 Re: DROP OWNED BY is broken on master branch.