postgresql/src
Peter Eisentraut 1c60e40ad5 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
2019-11-09 08:35:44 +01:00
..
backend Fix negative bitmapset member not allowed error in logical replication 2019-11-09 08:35:44 +01:00
bin Fix integer-overflow edge case detection in interval_mul and pgbench. 2019-11-07 11:22:58 -05:00
common Make StringInfo available to frontend code. 2019-11-05 14:56:40 -08:00
fe_utils Split all OBJS style lines in makefiles into one-line-per-entry style. 2019-11-05 14:41:07 -08:00
include Pass ItemPointer not HeapTuple to IndexBuildCallback. 2019-11-08 11:49:29 -08:00
interfaces Move declaration of ecpg_gettext() to a saner place. 2019-11-07 14:21:52 -05:00
makefiles Select CFLAGS_SL at configure time, not in platform-specific Makefiles. 2019-10-21 12:32:35 -04:00
pl Fix new COPY test of PL/pgSQL with VPATH builds 2019-11-09 15:41:34 +09:00
port Split all OBJS style lines in makefiles into one-line-per-entry style. 2019-11-05 14:41:07 -08:00
template Select CFLAGS_SL at configure time, not in platform-specific Makefiles. 2019-10-21 12:32:35 -04:00
test Fix negative bitmapset member not allowed error in logical replication 2019-11-09 08:35:44 +01:00
timezone Split all OBJS style lines in makefiles into one-line-per-entry style. 2019-11-05 14:41:07 -08:00
tools Make StringInfo available to frontend code. 2019-11-05 14:56:40 -08:00
tutorial Phase 2 pgindent run for v12. 2019-05-22 13:04:48 -04:00
.gitignore
DEVELOPERS
Makefile Fix partial-build problems introduced by having more generated headers. 2018-04-09 16:42:10 -04:00
Makefile.global.in Select CFLAGS_SL at configure time, not in platform-specific Makefiles. 2019-10-21 12:32:35 -04:00
Makefile.shlib Clean up MinGW def file generation 2019-10-20 10:19:13 +02:00
nls-global.mk NLS: Fix backend gettext triggers 2019-09-23 09:04:20 +02:00