Re: Added schema level support for publication.

From: vignesh C <vignesh21(at)gmail(dot)com>
To: "houzj(dot)fnst(at)fujitsu(dot)com" <houzj(dot)fnst(at)fujitsu(dot)com>
Cc: Greg Nancarrow <gregn4422(at)gmail(dot)com>, Amit Kapila <amit(dot)kapila16(at)gmail(dot)com>, Masahiko Sawada <sawada(dot)mshk(at)gmail(dot)com>, Peter Eisentraut <peter(dot)eisentraut(at)enterprisedb(dot)com>, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, Peter Smith <smithpb2250(at)gmail(dot)com>, "tanghy(dot)fnst(at)fujitsu(dot)com" <tanghy(dot)fnst(at)fujitsu(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>
Subject: Re: Added schema level support for publication.
Date: 2021-09-28 14:45:46
Message-ID: CALDaNm2Z9TfuoCf09YGKfwy7F1NwC4iCXJGTaZS=chH6VHtadQ@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Mon, Sep 27, 2021 at 12:15 PM houzj(dot)fnst(at)fujitsu(dot)com
<houzj(dot)fnst(at)fujitsu(dot)com> wrote:
>
> On Monday, September 27, 2021 12:32 PM vignesh C <vignesh21(at)gmail(dot)com> wrote:
> > On Fri, Sep 24, 2021 at 11:46 AM vignesh C <vignesh21(at)gmail(dot)com> wrote:
> > >
> >
> > Attached v33 patch has the preprocess_pubobj_list review comment fix
> > suggested by Alvaro at [1]. The
> > v33-0006-Alternate-grammar-for-ALL-TABLES-IN-SCHEMA.patch patch has
> > the grammar changes as suggested by Alvaro at [1]. If we agree this is better, I
> > will merge this into the 0001 patch.
> > [1] - https://www.postgresql.org/message-id/202109241325.eag5g6mpvoup%40alvherre.pgsql
>
> Hi,
>
> The grammar change basically looks good to me. Only one suggestion is that it
> will be better to add some more comments in gram.y to describe the rule
> PublicationObjSpec. Because it's a new style syntax in postgresql, people might
> wonder how the code work and why we choose this design when they first time
> see this rule in gram.y.
>
> Maybe something like the following:
>
> +/*
> + * FOR TABLE and FOR ALL TABLES IN SCHEMA specifications
> + *
> + * This rule parses publication object with and without keyword prefix.
> + *
> + * The actual type of the object without keyword prefix depends on the previous
> + * one with keyword prefix. It will be preprocessed in preprocess_pubobj_list().
> + *
> + * For the object without keyword prefix, we cannot just use relation_expr here,
> + * because some extended expression in relation_expr cannot be used as a
> + * schemaname and we cannot differentiate it. So, we extract the rules from
> + * relation_expr here.
> + */
> PublicationObjSpec:
> TABLE relation_expr
> ...
>
> My words might not be good, but I think it will be better to add some comments
> to explain a bit about the code in gram.y. Thoughts ?

Modified.

Attached v34 patch has the changes for the same.

Regards,
Vignesh

Attachment Content-Type Size
v34-0001-Added-schema-level-support-for-publication.patch text/x-patch 78.2 KB
v34-0002-Client-side-changes-to-support-FOR-ALL-TABLES-IN.patch text/x-patch 21.8 KB
v34-0003-Tests-for-FOR-ALL-TABLES-IN-SCHEMA-publication.patch text/x-patch 53.9 KB
v34-0004-Documentation-for-FOR-ALL-TABLES-IN-SCHEMA-publi.patch text/x-patch 15.2 KB
v34-0005-Implemented-pg_publication_objects-view.patch text/x-patch 6.2 KB

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message vignesh C 2021-09-28 14:47:08 Re: Added schema level support for publication.
Previous Message Dmitry Dolgov 2021-09-28 14:26:24 Re: POC: Cleaning up orphaned files using undo logs