Re: Added schema level support for publication.

From: Amit Kapila <amit(dot)kapila16(at)gmail(dot)com>
To: vignesh C <vignesh21(at)gmail(dot)com>
Cc: "houzj(dot)fnst(at)fujitsu(dot)com" <houzj(dot)fnst(at)fujitsu(dot)com>, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, Peter Smith <smithpb2250(at)gmail(dot)com>, Peter Eisentraut <peter(dot)eisentraut(at)enterprisedb(dot)com>, "tanghy(dot)fnst(at)fujitsu(dot)com" <tanghy(dot)fnst(at)fujitsu(dot)com>, Greg Nancarrow <gregn4422(at)gmail(dot)com>, Ajin Cherian <itsajin(at)gmail(dot)com>, Rahila Syed <rahilasyed90(at)gmail(dot)com>, PostgreSQL Hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>, Bharath Rupireddy <bharath(dot)rupireddyforpostgres(at)gmail(dot)com>, Masahiko Sawada <sawada(dot)mshk(at)gmail(dot)com>
Subject: Re: Added schema level support for publication.
Date: 2021-09-03 09:42:32
Message-ID: CAA4eK1LvKD2cHDY-5nsaiOfWmJOG5Khf4=5o7Bf=DOChjhWc1w@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Mon, Aug 30, 2021 at 8:56 PM vignesh C <vignesh21(at)gmail(dot)com> wrote:
>
> On Mon, Aug 30, 2021 at 9:10 AM houzj(dot)fnst(at)fujitsu(dot)com
> <houzj(dot)fnst(at)fujitsu(dot)com> wrote:
> >
>
> > 5)
> > + if (list_length(pubobj->name) == 1 &&
> > + (strcmp(relname, "CURRENT_SCHEMA") == 0))
> > + ereport(ERROR,
> > + errcode(ERRCODE_SYNTAX_ERROR),
> > + errmsg("invalid relation name at or near"),
> > + parser_errposition(pstate, pubobj->location));
> >
> > Maybe we don't need this check, because it will report an error in
> > OpenTableList() anyway, "relation "CURRENT_SCHEMA" does not exist" , and that
> > message seems readable to me.
>
> Allowing CURRENT_SCHEMA is required to support current schema for
> schema publications, currently I'm allowing this syntax during parsing
> and this error is thrown for relations later, this is done to keep the
> similar error as earlier before this feature support. I felt we can
> keep it like this to maintain the similar error. Thoughts?
>

I find this check quite ad-hoc in the code and I am not sure if we
need to be consistent for the exact message in this case. So, I think
it is better to remove it.

>
> > About 0003
> > 7)
> > The v22-0003 seems simple and can remove lots of code in patch v22-0001, so
> > maybe we can merge 0001 and 0003 into one patch ?
>
> I agree that the code becomes simpler, it reduces a lot of code. I had
> kept it like that as the testing effort might be more and also I was
> waiting if there was no objection for that syntax from anyone else. I
> will wait for a few more reviews and merge it to 0001 if there are no
> objections.
>

+1 to merge the patch as suggested by Hou-San.

--
With Regards,
Amit Kapila.

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Daniel Gustafsson 2021-09-03 09:53:01 Re: Trap errors from streaming child in pg_basebackup to exit early
Previous Message Tomas Vondra 2021-09-03 09:41:50 Re: Question about an Extension Project