From: Peter Eisentraut Date: Mon, 7 Aug 2017 14:28:35 +0000 (-0400) Subject: Fix handling of dropped columns in logical replication X-Git-Tag: REL_10_BETA3~6 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=0e58455dd48ca9cbc9987c47b8297d10f1c307b0;p=postgresql Fix handling of dropped columns in logical replication The relation attribute map was not initialized for dropped columns, leading to errors later on. Author: Petr Jelinek Reported-by: Scott Milliken Bug: #14769 --- diff --git a/src/backend/replication/logical/relation.c b/src/backend/replication/logical/relation.c index 7779857456..a7ea16d714 100644 --- a/src/backend/replication/logical/relation.c +++ b/src/backend/replication/logical/relation.c @@ -280,7 +280,10 @@ logicalrep_rel_open(LogicalRepRelId remoteid, LOCKMODE lockmode) int attnum; if (desc->attrs[i]->attisdropped) + { + entry->attrmap[i] = -1; continue; + } attnum = logicalrep_rel_att_by_name(remoterel, NameStr(desc->attrs[i]->attname));