pg.ddx.io pgsql-committers@postgresql.org mailing list archive
help / color / mirror / Atom feed From: Amit Kapila <akapila@postgresql.org>
To: pgsql-committers@lists.postgresql.org
Subject: pgsql: Allow publishing the tables of schema.
Date: Wed, 27 Oct 2021 02:26:55 +0000
Message-ID: <E1mfYeV-0004IP-Fq@gemulon.postgresql.org> (raw )
Allow publishing the tables of schema.
A new option "FOR ALL TABLES IN SCHEMA" in Create/Alter Publication allows
one or more schemas to be specified, whose tables are selected by the
publisher for sending the data to the subscriber.
The new syntax allows specifying both the tables and schemas. For example:
CREATE PUBLICATION pub1 FOR TABLE t1,t2,t3, ALL TABLES IN SCHEMA s1,s2;
OR
ALTER PUBLICATION pub1 ADD TABLE t1,t2,t3, ALL TABLES IN SCHEMA s1,s2;
A new system table "pg_publication_namespace" has been added, to maintain
the schemas that the user wants to publish through the publication.
Modified the output plugin (pgoutput) to publish the changes if the
relation is part of schema publication.
Updates pg_dump to identify and dump schema publications. Updates the \d
family of commands to display schema publications and \dRp+ variant will
now display associated schemas if any.
Author: Vignesh C, Hou Zhijie, Amit Kapila
Syntax-Suggested-by: Tom Lane, Alvaro Herrera
Reviewed-by: Greg Nancarrow, Masahiko Sawada, Hou Zhijie, Amit Kapila, Haiying Tang, Ajin Cherian, Rahila Syed, Bharath Rupireddy, Mark Dilger
Tested-by: Haiying Tang
Discussion: https://www.postgresql.org/message-id/CALDaNm0OANxuJ6RXqwZsM1MSY4s19nuH3734j4a72etDwvBETQ@mail.gmail...
Branch
------
master
Details
-------
https://git.postgresql.org/pg/commitdiff/5a2832465fd8984d089e8c44c094e6900d987fcd
Modified Files
--------------
doc/src/sgml/catalogs.sgml | 72 +++-
doc/src/sgml/logical-replication.sgml | 14 +-
doc/src/sgml/ref/alter_publication.sgml | 77 +++-
doc/src/sgml/ref/create_publication.sgml | 76 +++-
doc/src/sgml/ref/psql-ref.sgml | 4 +-
src/backend/catalog/Makefile | 4 +-
src/backend/catalog/aclchk.c | 2 +
src/backend/catalog/dependency.c | 9 +
src/backend/catalog/objectaddress.c | 149 +++++++
src/backend/catalog/pg_publication.c | 332 +++++++++++++++-
src/backend/commands/alter.c | 1 +
src/backend/commands/event_trigger.c | 4 +
src/backend/commands/publicationcmds.c | 490 +++++++++++++++++++++--
src/backend/commands/seclabel.c | 1 +
src/backend/commands/tablecmds.c | 28 ++
src/backend/nodes/copyfuncs.c | 22 +-
src/backend/nodes/equalfuncs.c | 21 +-
src/backend/parser/gram.y | 307 +++++++++++----
src/backend/replication/pgoutput/pgoutput.c | 19 +-
src/backend/utils/cache/relcache.c | 7 +
src/backend/utils/cache/syscache.c | 23 ++
src/bin/pg_dump/common.c | 5 +-
src/bin/pg_dump/pg_backup_archiver.c | 3 +-
src/bin/pg_dump/pg_dump.c | 143 ++++++-
src/bin/pg_dump/pg_dump.h | 13 +
src/bin/pg_dump/pg_dump_sort.c | 7 +
src/bin/pg_dump/t/002_pg_dump.pl | 30 ++
src/bin/psql/describe.c | 198 ++++++++--
src/bin/psql/tab-complete.c | 40 +-
src/include/catalog/catversion.h | 2 +-
src/include/catalog/dependency.h | 1 +
src/include/catalog/pg_publication.h | 8 +
src/include/catalog/pg_publication_namespace.h | 47 +++
src/include/commands/publicationcmds.h | 1 +
src/include/nodes/nodes.h | 1 +
src/include/nodes/parsenodes.h | 33 +-
src/include/utils/syscache.h | 2 +
src/test/regress/expected/alter_table.out | 14 +
src/test/regress/expected/object_address.out | 6 +-
src/test/regress/expected/oidjoins.out | 2 +
src/test/regress/expected/publication.out | 522 ++++++++++++++++++++++++-
src/test/regress/expected/sanity_check.out | 1 +
src/test/regress/sql/alter_table.sql | 12 +
src/test/regress/sql/object_address.sql | 3 +
src/test/regress/sql/publication.sql | 281 ++++++++++++-
src/tools/pgindent/typedefs.list | 5 +
46 files changed, 2830 insertions(+), 212 deletions(-)
Message-ID: <E1mfYeV-0004IP-Fq@gemulon.postgresql.org>
Permalink: ../E1mfYeV-0004IP-Fq@gemulon.postgresql.org/
Also on: postgresql.org/message-id/E1mfYeV-0004IP-Fq@gemulon.postgresql.org
copy link · copy postgr.es
reply Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-committers@postgresql.org
Cc: akapila@postgresql.org
Subject: Re: pgsql: Allow publishing the tables of schema.
In-Reply-To: <E1mfYeV-0004IP-Fq@gemulon.postgresql.org>
References: <E1mfYeV-0004IP-Fq@gemulon.postgresql.org>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox