From: Peter Eisentraut <peter@eisentraut.org>
To: pgsql-committers@lists.postgresql.org
Subject: pgsql: Fix negative bitmapset member not allowed error in logical repli
Date: Sat, 09 Nov 2019 08:17:03 +0000
Message-ID: <E1iTLvb-0008IB-ON@gemulon.postgresql.org> (raw)
Fix negative bitmapset member not allowed error in logical replication
This happens when we add a replica identity column on a subscriber
that does not yet exist on the publisher, according to the mapping
maintained by the subscriber. Code that checks whether the target
relation on the subscriber is updatable would check the replica
identity attribute bitmap with a column number -1, which would result
in an error. To fix, skip such columns in the bitmap lookup and
consider the relation not updatable. The result is consistent with
the rule that the replica identity columns on the subscriber must be a
subset of those on the publisher, since if the column doesn't exist on
the publisher, the column set on the subscriber can't be a subset.
Reported-by: Tim Clarke <tim.clarke@minerva.info>
Analyzed-by: Jehan-Guillaume de Rorthais <jgdr@dalibo.com>
Discussion: https://www.postgresql.org/message-id/flat/a9139c29-7ddd-973b-aa7f-71fed9c38d75%40minerva.info
Branch
------
REL_12_STABLE
Details
-------
https://git.postgresql.org/pg/commitdiff/d891d2c897859e86a7728afd151e8c07f2511168
Modified Files
--------------
src/backend/replication/logical/relation.c | 3 ++-
src/test/subscription/t/008_diff_schema.pl | 37 ++++++++++++++++++++++++++++--
2 files changed, 37 insertions(+), 3 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: peter@eisentraut.org
Subject: Re: pgsql: Fix negative bitmapset member not allowed error in logical repli
In-Reply-To: <E1iTLvb-0008IB-ON@gemulon.postgresql.org>
References: <E1iTLvb-0008IB-ON@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