aboutsummaryrefslogtreecommitdiff
path: root/src/backend/replication/logical/tablesync.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/backend/replication/logical/tablesync.c')
-rw-r--r--src/backend/replication/logical/tablesync.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/src/backend/replication/logical/tablesync.c b/src/backend/replication/logical/tablesync.c
index d287e95df1d..108326bef1c 100644
--- a/src/backend/replication/logical/tablesync.c
+++ b/src/backend/replication/logical/tablesync.c
@@ -93,6 +93,8 @@
#include "commands/copy.h"
+#include "parser/parse_relation.h"
+
#include "replication/logicallauncher.h"
#include "replication/logicalrelation.h"
#include "replication/walreceiver.h"
@@ -654,6 +656,7 @@ copy_table(Relation rel)
StringInfoData cmd;
CopyState cstate;
List *attnamelist;
+ ParseState *pstate;
/* Get the publisher relation info. */
fetch_remote_table_info(get_namespace_name(RelationGetNamespace(rel)),
@@ -680,9 +683,11 @@ copy_table(Relation rel)
copybuf = makeStringInfo();
- /* Create CopyState for ingestion of the data from publisher. */
+ pstate = make_parsestate(NULL);
+ addRangeTableEntryForRelation(pstate, rel, NULL, false, false);
+
attnamelist = make_copy_attnamelist(relmapentry);
- cstate = BeginCopyFrom(NULL, rel, NULL, false, copy_read_data, attnamelist, NIL);
+ cstate = BeginCopyFrom(pstate, rel, NULL, false, copy_read_data, attnamelist, NIL);
/* Do the copy */
(void) CopyFrom(cstate);