pg.ddx.io pgsql-committers@postgresql.org mailing list archivehelp / color / mirror / Atom feed
pgsql: Allow publications with schema and table of the same schema. 2+ messages / 1 participants [nested] [flat]
* pgsql: Allow publications with schema and table of the same schema. @ 2022-09-23 03:06 Amit Kapila <akapila@postgresql.org> 0 siblings, 0 replies; 2+ messages in thread From: Amit Kapila @ 2022-09-23 03:06 UTC (permalink / raw) To: pgsql-committers@lists.postgresql.org 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 Branch ------ master Details ------- https://git.postgresql.org/pg/commitdiff/13a185f54ba594a5fb42bac3e1ecbdfd62b9041f Modified Files -------------- doc/src/sgml/logical-replication.sgml | 5 + doc/src/sgml/ref/alter_publication.sgml | 15 ++- doc/src/sgml/ref/create_publication.sgml | 20 ++-- src/backend/catalog/pg_publication.c | 15 ++- src/backend/commands/publicationcmds.c | 156 ++++++++++------------------ src/backend/commands/tablecmds.c | 27 ----- src/backend/replication/pgoutput/pgoutput.c | 31 +++--- src/bin/pg_dump/t/002_pg_dump.pl | 14 +++ src/test/regress/expected/alter_table.out | 14 ++- src/test/regress/expected/publication.out | 90 ++++++++++++++-- src/test/regress/sql/alter_table.sql | 3 +- src/test/regress/sql/publication.sql | 44 +++++++- src/test/subscription/t/028_row_filter.pl | 2 +- 13 files changed, 251 insertions(+), 185 deletions(-) ^ permalink raw reply [nested|flat] 2+ messages in thread
* pgsql: Allow publications with schema and table of the same schema. @ 2022-09-23 03:06 Amit Kapila <akapila@postgresql.org> 0 siblings, 0 replies; 2+ messages in thread From: Amit Kapila @ 2022-09-23 03:06 UTC (permalink / raw) To: pgsql-committers@lists.postgresql.org 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 Branch ------ REL_15_STABLE Details ------- https://git.postgresql.org/pg/commitdiff/b7256753ec251fd6a1f6bd205dbe62ccbb3261c4 Modified Files -------------- doc/src/sgml/logical-replication.sgml | 5 + doc/src/sgml/ref/alter_publication.sgml | 15 ++- doc/src/sgml/ref/create_publication.sgml | 20 ++-- src/backend/catalog/pg_publication.c | 15 ++- src/backend/commands/publicationcmds.c | 156 ++++++++++------------------ src/backend/commands/tablecmds.c | 27 ----- src/backend/replication/pgoutput/pgoutput.c | 31 +++--- src/bin/pg_dump/t/002_pg_dump.pl | 14 +++ src/test/regress/expected/alter_table.out | 14 ++- src/test/regress/expected/publication.out | 90 ++++++++++++++-- src/test/regress/sql/alter_table.sql | 3 +- src/test/regress/sql/publication.sql | 44 +++++++- src/test/subscription/t/028_row_filter.pl | 2 +- 13 files changed, 251 insertions(+), 185 deletions(-) ^ permalink raw reply [nested|flat] 2+ messages in thread
end of thread, other threads:[~2022-09-23 03:06 UTC | newest] Thread overview: 2+ messages (download: mbox mbox.gz follow: Atom feed) -- links below jump to the message on this page -- 2022-09-23 03:06 pgsql: Allow publications with schema and table of the same schema. Amit Kapila <akapila@postgresql.org> 2022-09-23 03:06 pgsql: Allow publications with schema and table of the same schema. Amit Kapila <akapila@postgresql.org>
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