]> git.ipfire.org Git - thirdparty/postgresql.git/commit
Allow table exclusions in publications via EXCEPT TABLE.
authorAmit Kapila <akapila@postgresql.org>
Wed, 4 Mar 2026 10:25:01 +0000 (15:55 +0530)
committerAmit Kapila <akapila@postgresql.org>
Wed, 4 Mar 2026 10:26:48 +0000 (15:56 +0530)
commitfd366065e06ae953c4f2d973d5c5f0474f3b87b6
tree3f43381e6a76dff48d2a0eb1152771e73cc5f6bc
parentfe08113aefc9dec62f218d5d712dde4ffbb0f0a3
Allow table exclusions in publications via EXCEPT TABLE.

Extend CREATE PUBLICATION ... FOR ALL TABLES to support the EXCEPT TABLE
syntax. This allows one or more tables to be excluded. The publisher will
not send the data of excluded tables to the subscriber.

To support this, pg_publication_rel now includes a prexcept column to flag
excluded relations. For partitioned tables, the exclusion is applied at
the root level; specifying a root table excludes all current and future
partitions in that tree.

Follow-up work will implement ALTER PUBLICATION support for managing these
exclusions.

Author: vignesh C <vignesh21@gmail.com>
Author: Shlok Kyal <shlok.kyal.oss@gmail.com>
Reviewed-by: shveta malik <shveta.malik@gmail.com>
Reviewed-by: Amit Kapila <amit.kapila16@gmail.com>
Reviewed-by: Peter Smith <smithpb2250@gmail.com>
Reviewed-by: Dilip Kumar <dilipbalaut@gmail.com>
Reviewed-by: Zhijie Hou <houzj.fnst@fujitsu.com>
Reviewed-by: Nisha Moond <nisha.moond412@gmail.com>
Reviewed-by: David G. Johnston <david.g.johnston@gmail.com>
Reviewed-by: Ashutosh Sharma <ashu.coek88@gmail.com>
Reviewed-by: Chao Li <li.evan.chao@gmail.com>
Reviewed-by: Andrei Lepikhov <lepihov@gmail.com>
Discussion: https://postgr.es/m/CALDaNm3=JrucjhiiwsYQw5-PGtBHFONa6F7hhWCXMsGvh=tamA@mail.gmail.com
23 files changed:
doc/src/sgml/catalogs.sgml
doc/src/sgml/logical-replication.sgml
doc/src/sgml/ref/create_publication.sgml
doc/src/sgml/ref/psql-ref.sgml
src/backend/catalog/pg_publication.c
src/backend/commands/publicationcmds.c
src/backend/commands/tablecmds.c
src/backend/parser/gram.y
src/backend/replication/pgoutput/pgoutput.c
src/backend/utils/cache/relcache.c
src/bin/pg_dump/pg_dump.c
src/bin/pg_dump/pg_dump.h
src/bin/pg_dump/t/002_pg_dump.pl
src/bin/psql/describe.c
src/bin/psql/tab-complete.in.c
src/include/catalog/catversion.h
src/include/catalog/pg_publication.h
src/include/catalog/pg_publication_rel.h
src/include/nodes/parsenodes.h
src/test/regress/expected/publication.out
src/test/regress/sql/publication.sql
src/test/subscription/meson.build
src/test/subscription/t/037_except.pl [new file with mode: 0644]