summaryrefslogtreecommitdiff
path: root/src/backend/replication/logical/worker.c
diff options
context:
space:
mode:
authorPeter Eisentraut <peter_e@gmx.net>2017-08-07 10:49:08 -0400
committerPeter Eisentraut <peter_e@gmx.net>2017-08-07 10:49:08 -0400
commitfca17a933b4b3cedcd41f14b0fe4d3fb439ea4a4 (patch)
treedce3559b39d9fa68ca4819a6bdaf390814c4c736 /src/backend/replication/logical/worker.c
parent0e58455dd48ca9cbc9987c47b8297d10f1c307b0 (diff)
Fix local/remote attribute mix-up in logical replication
This would lead to failures if local and remote tables have a different column order. The tests previously didn't catch that because they only tested the initial data copy. So add another test that exercises the apply worker. Author: Petr Jelinek <petr.jelinek@2ndquadrant.com>
Diffstat (limited to 'src/backend/replication/logical/worker.c')
-rw-r--r--src/backend/replication/logical/worker.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/backend/replication/logical/worker.c b/src/backend/replication/logical/worker.c
index 0d48dfa4947..7c2df576457 100644
--- a/src/backend/replication/logical/worker.c
+++ b/src/backend/replication/logical/worker.c
@@ -402,7 +402,8 @@ slot_modify_cstrings(TupleTableSlot *slot, LogicalRepRelMapEntry *rel,
errarg.attnum = remoteattnum;
getTypeInputInfo(att->atttypid, &typinput, &typioparam);
- slot->tts_values[i] = OidInputFunctionCall(typinput, values[i],
+ slot->tts_values[i] = OidInputFunctionCall(typinput,
+ values[remoteattnum],
typioparam,
att->atttypmod);
slot->tts_isnull[i] = false;