Set es_output_cid in replication worker
authorSimon Riggs <[email protected]>
Wed, 22 Nov 2017 05:28:14 +0000 (16:28 +1100)
committerSimon Riggs <[email protected]>
Wed, 22 Nov 2017 05:28:14 +0000 (16:28 +1100)
Allows triggers to operate correctly

Author: Petr Jelinek <[email protected]>
Reported-by: Konstantin Knizhnik <[email protected]>
src/backend/replication/logical/worker.c

index 0e68670767ae566fdc0018e4a7bc761800da8e71..fa5d9bb12019a3821f8860f2231b8b1714e3d5cc 100644 (file)
@@ -204,6 +204,8 @@ create_estate_for_relation(LogicalRepRelMapEntry *rel)
    estate->es_num_result_relations = 1;
    estate->es_result_relation_info = resultRelInfo;
 
+   estate->es_output_cid = GetCurrentCommandId(true);
+
    /* Triggers might need a slot */
    if (resultRelInfo->ri_TrigDesc)
        estate->es_trig_tuple_slot = ExecInitExtraTupleSlot(estate);