From fca17a933b4b3cedcd41f14b0fe4d3fb439ea4a4 Mon Sep 17 00:00:00 2001 From: Peter Eisentraut Date: Mon, 7 Aug 2017 10:49:08 -0400 Subject: 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 --- src/backend/replication/logical/worker.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src/backend/replication/logical/worker.c') 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; -- cgit v1.2.3