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: PostgreSQL Hackers <pgsql-hackers@lists.postgresql.org>
Date: 2021-01-18T13:45:25Z
Lists: pgsql-hackers
Attachments
- v2-0001-Added-schema-level-support-for-publication.patch (application/x-patch) patch v2-0001
On Sat, Jan 9, 2021 at 5:21 PM vignesh C <vignesh21@gmail.com> wrote: > > On Fri, Jan 8, 2021 at 4:32 PM Amit Kapila <amit.kapila16@gmail.com> wrote: > > > > On Thu, Jan 7, 2021 at 10:03 PM vignesh C <vignesh21@gmail.com> wrote: > > > > > > 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; > > > > > > 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; > > > > > > Drop some schema from the publication: > > > ALTER PUBLICATION production_quarterly_publication DROP SCHEMA production_july; > > > > > > Attached is a POC patch for the same. I felt this feature would be quite useful. > > > > > > > What do we do if the user Drops the schema? Do we automatically remove > > it from the publication? > > > I have not yet handled this scenario yet, I will handle this and > adding of tests in the next patch. > I have handled the above scenario(drop schema should automatically remove the schema entry from publication schema relation) & addition of tests in the new v2 patch attached. Thoughts? Regards, Vignesh EnterpriseDB: http://www.enterprisedb.com
Commits
-
Include schema/table publications even with exclude options in dump.
- 4aa6fa3cd0a2 18.0 landed
-
Rename some enums to use TABLE instead of REL.
- b3812d0b9bcf 15.0 landed
-
Add tap tests for the schema publications.
- 6b0f6f79eef2 15.0 landed
-
Allow publishing the tables of schema.
- 5a2832465fd8 15.0 landed
-
In pg_dump, use simplehash.h to look up dumpable objects by OID.
- 92316a4582a5 15.0 cited