diff options
Diffstat (limited to 'src/backend/replication/logical/worker.c')
-rw-r--r-- | src/backend/replication/logical/worker.c | 20 |
1 files changed, 13 insertions, 7 deletions
diff --git a/src/backend/replication/logical/worker.c b/src/backend/replication/logical/worker.c index 277da69fa6c..3cd1e0d728e 100644 --- a/src/backend/replication/logical/worker.c +++ b/src/backend/replication/logical/worker.c @@ -213,7 +213,8 @@ create_estate_for_relation(LogicalRepRelMapEntry *rel) /* Triggers might need a slot */ if (resultRelInfo->ri_TrigDesc) - estate->es_trig_tuple_slot = ExecInitExtraTupleSlot(estate, NULL); + estate->es_trig_tuple_slot = ExecInitExtraTupleSlot(estate, NULL, + &TTSOpsVirtual); /* Prepare to catch AFTER triggers. */ AfterTriggerBeginQuery(); @@ -609,7 +610,8 @@ apply_handle_insert(StringInfo s) /* Initialize the executor state. */ estate = create_estate_for_relation(rel); remoteslot = ExecInitExtraTupleSlot(estate, - RelationGetDescr(rel->localrel)); + RelationGetDescr(rel->localrel), + &TTSOpsHeapTuple); /* Input functions may need an active snapshot, so get one */ PushActiveSnapshot(GetTransactionSnapshot()); @@ -715,9 +717,11 @@ apply_handle_update(StringInfo s) /* Initialize the executor state. */ estate = create_estate_for_relation(rel); remoteslot = ExecInitExtraTupleSlot(estate, - RelationGetDescr(rel->localrel)); + RelationGetDescr(rel->localrel), + &TTSOpsHeapTuple); localslot = ExecInitExtraTupleSlot(estate, - RelationGetDescr(rel->localrel)); + RelationGetDescr(rel->localrel), + &TTSOpsHeapTuple); EvalPlanQualInit(&epqstate, estate, NULL, NIL, -1); PushActiveSnapshot(GetTransactionSnapshot()); @@ -756,7 +760,7 @@ apply_handle_update(StringInfo s) { /* Process and store remote tuple in the slot */ oldctx = MemoryContextSwitchTo(GetPerTupleMemoryContext(estate)); - ExecStoreHeapTuple(localslot->tts_tuple, remoteslot, false); + ExecCopySlot(remoteslot, localslot); slot_modify_cstrings(remoteslot, rel, newtup.values, newtup.changed); MemoryContextSwitchTo(oldctx); @@ -833,9 +837,11 @@ apply_handle_delete(StringInfo s) /* Initialize the executor state. */ estate = create_estate_for_relation(rel); remoteslot = ExecInitExtraTupleSlot(estate, - RelationGetDescr(rel->localrel)); + RelationGetDescr(rel->localrel), + &TTSOpsVirtual); localslot = ExecInitExtraTupleSlot(estate, - RelationGetDescr(rel->localrel)); + RelationGetDescr(rel->localrel), + &TTSOpsHeapTuple); EvalPlanQualInit(&epqstate, estate, NULL, NIL, -1); PushActiveSnapshot(GetTransactionSnapshot()); |