aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPeter Eisentraut <peter_e@gmx.net>2017-08-07 10:28:35 -0400
committerPeter Eisentraut <peter_e@gmx.net>2017-08-07 10:28:35 -0400
commit0e58455dd48ca9cbc9987c47b8297d10f1c307b0 (patch)
tree5557c614b961233d2a56758e5ee67fec9bd06826
parent8d9881911f0d30e0783a6bb1363b94a2c817433d (diff)
downloadpostgresql-0e58455dd48ca9cbc9987c47b8297d10f1c307b0.tar.gz
postgresql-0e58455dd48ca9cbc9987c47b8297d10f1c307b0.zip
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 <petr.jelinek@2ndquadrant.com> Reported-by: Scott Milliken <scott@deltaex.com> Bug: #14769
-rw-r--r--src/backend/replication/logical/relation.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/backend/replication/logical/relation.c b/src/backend/replication/logical/relation.c
index 77798574562..a7ea16d714b 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));