RE: Added schema level support for publication.

From: "houzj(dot)fnst(at)fujitsu(dot)com" <houzj(dot)fnst(at)fujitsu(dot)com>
To: Amit Kapila <amit(dot)kapila16(at)gmail(dot)com>
Cc: vignesh C <vignesh21(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>, 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>
Subject: RE: Added schema level support for publication.
Date: 2021-09-23 06:51:53
Message-ID: OS3PR01MB571844A87B6A83B7C10F9D6B94A39@OS3PR01MB5718.jpnprd01.prod.outlook.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

From Thurs, Sep 23, 2021 12:09 PM Amit Kapila <amit(dot)kapila16(at)gmail(dot)com> wrote:
> On Wed, Sep 22, 2021 at 5:03 PM Hou Zhijie <houzj(dot)fnst(at)fujitsu(dot)com> wrote:
> >
> > Personally, I think we'd better move the code about changing publication's
> > tablelist into AlterPublicationTables and the code about changing
> publication's
> > schemalist into AlterPublicationSchemas. It's similar to what the
> v29-patchset
> > did, the difference is the SET action, I suggest we drop all the tables in
> > function AlterPublicationTables when user only set schemas and drop all the
> > schema in AlterPublicationSchemas when user only set tables. In this
> approach,
> > we can keep schema and relation code separate and don't need to worry
> > about the locking order.
> >
> > Attach a top-up patch which refactor the code like above.
> >
>
> Good suggestion. I think it would still be better if we can move the
> checks related to superuser and puballtables into a separate function
> that gets called before taking a lock on publication.

I agreed.

I noticed v30-0001 has been committed with some minor changes, and the V30-0002
patchset need to be rebased accordingly. Attach a rebased version patch set to
make cfbot happy. Also Attach the two top-up patches which refactor the code as
suggested. (top-up patch 1 is to keep schema and table code separate, top-up
patch 2 is to move some cheap check into a function and invoke it before
locking.)

Best regards,
Hou zj

Attachment Content-Type Size
top-up-1-schema-refactor.patch application/octet-stream 10.8 KB
top-up-2-move-check-into-a-separate-function.patch application/octet-stream 3.9 KB
v31-0001-Added-schema-level-support-for-publication.patch application/octet-stream 77.3 KB
v31-0002-Client-side-changes-to-support-FOR-ALL-TABLES-IN.patch application/octet-stream 21.6 KB
v31-0003-Tests-for-FOR-ALL-TABLES-IN-SCHEMA-publication.patch application/octet-stream 52.2 KB
v31-0004-Documentation-for-FOR-ALL-TABLES-IN-SCHEMA-publi.patch application/octet-stream 15.4 KB
v31-0005-Implemented-pg_publication_objects-view.patch application/octet-stream 6.2 KB

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message tushar 2021-09-23 06:54:57 Re: extensible options syntax for replication parser?
Previous Message Simon Riggs 2021-09-23 06:37:27 Re: Hook for extensible parsing.