Re: Added schema level support for publication. - Mailing list pgsql-hackers

From Rahila Syed
Subject Re: Added schema level support for publication.
Date
Msg-id CAH2L28u5HqDO3xj7J0md1tDTaiNQzzG9iu+xd1_C0qbuXXDukA@mail.gmail.com
Whole thread Raw
In response to Added schema level support for publication.  (vignesh C <vignesh21@gmail.com>)
Responses Re: Added schema level support for publication.  (vignesh C <vignesh21@gmail.com>)
List pgsql-hackers
Hi Vignesh,

I had a look at the patch, please consider following comments.

On Thu, Jan 7, 2021 at 10:03 PM vignesh C <vignesh21@gmail.com> wrote:
Hi,

This feature adds schema option while creating publication. Users will
be able to specify one or more schemas while creating publication,
when the user specifies schema option, then the data changes for the
tables present in the schema specified by the user will be replicated
to the subscriber. Few examples have been listed below:

Create a publication that publishes all changes for all the tables
present in production schema:
CREATE PUBLICATION production_publication FOR ALL TABLES SCHEMA production;

Should it be FOR TABLES IN SCHEMA instead of FOR ALL TABLES SCHEMA?
 
Create a publication that publishes all changes for all the tables
present in marketing and sales schemas:
CREATE PUBLICATION sales_publication FOR ALL TABLES SCHEMA marketing, sales;

Add some schemas to the publication:
ALTER PUBLICATION sales_publication ADD SCHEMA marketing_june, sales_june;

As per current implementation this command fails even if one of the schemas does not 
exist. I think this is counterintuitive, it should throw a warning and continue adding the rest.
 
Drop some schema from the publication:
ALTER PUBLICATION production_quarterly_publication DROP SCHEMA production_july;

Same for drop schema, if one of these schemas does not exist in publication,
the entire DROP operation is aborted.
 
Thank you,
Rahila Syed
 

pgsql-hackers by date:

Previous
From: torikoshia
Date:
Subject: Re: Is it useful to record whether plans are generic or custom?
Next
From: japin
Date:
Subject: Re: Logical Replication - behavior of ALTER PUBLICATION .. DROP TABLE and ALTER SUBSCRIPTION .. REFRESH PUBLICATION