Re: Added schema level support for publication.

Greg Nancarrow <gregn4422@gmail.com>

From: Greg Nancarrow <gregn4422@gmail.com>
To: vignesh C <vignesh21@gmail.com>
Cc: Masahiko Sawada <sawada.mshk@gmail.com>, Tom Lane <tgl@sss.pgh.pa.us>, Amit Kapila <amit.kapila16@gmail.com>, Peter Smith <smithpb2250@gmail.com>, Peter Eisentraut <peter.eisentraut@enterprisedb.com>, "tanghy.fnst@fujitsu.com" <tanghy.fnst@fujitsu.com>, Ajin Cherian <itsajin@gmail.com>, "houzj.fnst@fujitsu.com" <houzj.fnst@fujitsu.com>, Rahila Syed <rahilasyed90@gmail.com>, PostgreSQL Hackers <pgsql-hackers@lists.postgresql.org>, Bharath Rupireddy <bharath.rupireddyforpostgres@gmail.com>
Date: 2021-08-30T02:53:16Z
Lists: pgsql-hackers
On Fri, Aug 27, 2021 at 4:13 PM vignesh C <vignesh21@gmail.com> wrote:
>
> I have implemented this in the 0003 patch, I have kept it separate to
> reduce the testing effort and also it will be easier if someone
> disagrees with the syntax. I will merge it to the main patch later
> based on the feedback. Attached v22 patch has the changes for the
> same.

Just experimenting with the new syntax so far, and seeing some new
messages and docs, I have the following suggestions for improvements:

src/backend/commands/publicationcmds.c

(1)
BEFORE:
for table/for all tables in schema should be specified before the object
AFTER:
FOR TABLE / FOR ALL TABLES IN SCHEMA should be specified before the
table/schema name(s)

(2)
BEFORE:
Tables cannot be added, dropped or set on FOR ALL TABLES publications.
AFTER:
Tables cannot be added to, dropped from, or set on FOR ALL TABLES publications.

(3)
BEFORE:
Schemas cannot be added, dropped or set on FOR ALL TABLES publications.
AFTER:
Schemas cannot be added to, dropped from, or set on FOR ALL TABLES publications.


v22-0002

doc/src/sgml/ref/create_publication.sgml

(1)
BEFORE:
+   Create a publication that publishes all changes for users and departments
+   table and that publishes all changes for all the tables present in the
AFTER:
+   Create a publication that publishes all changes for tables "users" and
+   "departments" and that publishes all changes for all the tables
present in the


Regards,
Greg Nancarrow
Fujitsu Australia



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.