From: Amit Kapila <akapila@postgresql.org>
To: pgsql-committers@lists.postgresql.org
Subject: pgsql: Prohibit combining publications with different column lists.
Date: Thu, 02 Jun 2022 03:13:11 +0000
Message-ID: <E1nwbGp-002I3O-03@gemulon.postgresql.org> (raw)
Prohibit combining publications with different column lists.
Currently, we simply combine the column lists when publishing tables on
multiple publications and that can sometimes lead to unexpected behavior.
Say, if a column is published in any row-filtered publication, then the
values for that column are sent to the subscriber even for rows that don't
match the row filter, as long as the row matches the row filter for any
other publication, even if that other publication doesn't include the
column.
The main purpose of introducing a column list is to have statically
different shapes on publisher and subscriber or hide sensitive column
data. In both cases, it doesn't seem to make sense to combine column
lists.
So, we disallow the cases where the column list is different for the same
table when combining publications. It can be later extended to combine the
column lists for selective cases where required.
Reported-by: Alvaro Herrera
Author: Hou Zhijie
Reviewed-by: Amit Kapila
Discussion: https://postgr.es/m/202204251548.mudq7jbqnh7r@alvherre.pgsql
Branch
------
master
Details
-------
https://git.postgresql.org/pg/commitdiff/fd0b9dcebda7b931a41ce5c8e86d13f2efd0af2e
Modified Files
--------------
doc/src/sgml/ref/alter_publication.sgml | 12 ++-
doc/src/sgml/ref/create_subscription.sgml | 5 +
src/backend/commands/subscriptioncmds.c | 28 +++++-
src/backend/replication/logical/tablesync.c | 72 ++++++-------
src/backend/replication/pgoutput/pgoutput.c | 80 +++++++--------
src/test/subscription/t/031_column_list.pl | 150 ++++++++++++----------------
6 files changed, 181 insertions(+), 166 deletions(-)
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: Prohibit combining publications with different column lists.
In-Reply-To: <E1nwbGp-002I3O-03@gemulon.postgresql.org>
References: <E1nwbGp-002I3O-03@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