Re: Added schema level support for publication.

vignesh C <vignesh21@gmail.com>

From: vignesh C <vignesh21@gmail.com>
To: Amit Kapila <amit.kapila16@gmail.com>
Cc: Bharath Rupireddy <bharath.rupireddyforpostgres@gmail.com>, PostgreSQL Hackers <pgsql-hackers@lists.postgresql.org>
Date: 2021-06-17T01:05:16Z
Lists: pgsql-hackers
On Wed, Jun 16, 2021 at 4:59 PM Amit Kapila <amit.kapila16@gmail.com> wrote:
>
> On Sat, Jan 9, 2021 at 8:08 PM Bharath Rupireddy
> <bharath.rupireddyforpostgres@gmail.com> wrote:
> >
> > And, with this feature, since there can be many huge tables inside a
> > schema, the initial table sync phase of the replication can take a
> > while.
> >
> > Say a user has created a publication for a schema with hundreds of
> > tables in it, at some point later, can he stop replicating a single or
> > some tables from that schema?
> >
>
> Isn't this applies to FOR ALL TABLES syntax as well where the user
> might want to exclude one or a few tables? I am not sure if it is a
> good idea to deal with this as part of this patch.

Yes, this applies to "FOR ALL TABLES" publications also, i had worked for
this, the patch for the same is attached at [1]. I had created a separate
patch for this so that it is easier for reviewing.

[1] -
https://www.postgresql.org/message-id/CALDaNm10g2h29a-oFHsadk-Du6RDhnVQT_vfTGqR82DsjxQLqQ%40mail.gmail.com

Regards,
Vignesh

Commits

  1. Include schema/table publications even with exclude options in dump.

  2. Rename some enums to use TABLE instead of REL.

  3. Add tap tests for the schema publications.

  4. Allow publishing the tables of schema.

  5. In pg_dump, use simplehash.h to look up dumpable objects by OID.