]> git.ipfire.org Git - thirdparty/postgresql.git/commit
Allow publications with schema and table of the same schema.
authorAmit Kapila <akapila@postgresql.org>
Fri, 23 Sep 2022 02:38:24 +0000 (08:08 +0530)
committerAmit Kapila <akapila@postgresql.org>
Fri, 23 Sep 2022 02:38:24 +0000 (08:08 +0530)
commitb7256753ec251fd6a1f6bd205dbe62ccbb3261c4
tree683a1ac6a69f1e6cb72f7313380db1ccb588c172
parentdd6070bc81733c3174f2e257d43908f98b0255fb
Allow publications with schema and table of the same schema.

We previously thought that allowing such cases can confuse users when they
specify DROP TABLES IN SCHEMA but that doesn't seem to be the case based
on discussion. This helps to uplift the restriction during
ALTER TABLE ... SET SCHEMA which used to ensure that we couldn't end up
with a publication having both a schema and the same schema's table.

To allow this, we need to forbid having any schema on a publication if
column lists on a table are specified (and vice versa). This is because
otherwise we still need a restriction during ALTER TABLE ... SET SCHEMA to
forbid cases where it could lead to a publication having both a schema and
the same schema's table with column list.

Based on suggestions by Peter Eisentraut.

Author: Hou Zhijie and Vignesh C
Reviewed-By: Peter Smith, Amit Kapila
Backpatch-through: 15, where it was introduced
Discussion: https://postgr.es/m/2729c9e2-9aac-8cda-f2f4-34f2bcc18f4e@enterprisedb.com
13 files changed:
doc/src/sgml/logical-replication.sgml
doc/src/sgml/ref/alter_publication.sgml
doc/src/sgml/ref/create_publication.sgml
src/backend/catalog/pg_publication.c
src/backend/commands/publicationcmds.c
src/backend/commands/tablecmds.c
src/backend/replication/pgoutput/pgoutput.c
src/bin/pg_dump/t/002_pg_dump.pl
src/test/regress/expected/alter_table.out
src/test/regress/expected/publication.out
src/test/regress/sql/alter_table.sql
src/test/regress/sql/publication.sql
src/test/subscription/t/028_row_filter.pl