@@ -632,12 +632,6 @@ PathmanCopyFrom(CopyState cstate, Relation parent_rel,
632
632
if (tuple_oid != InvalidOid )
633
633
HeapTupleSetOid (tuple ,tuple_oid );
634
634
635
- /*
636
- * Constraints might reference the tableoid column, so initialize
637
- * t_tableOid before evaluating them.
638
- */
639
- tuple -> t_tableOid = RelationGetRelid (child_result_rel -> ri_RelationDesc );
640
-
641
635
/* Place tuple in tuple slot --- but slot shouldn't free it */
642
636
slot = myslot ;
643
637
ExecStoreTuple (tuple ,slot ,InvalidBuffer , false);
@@ -661,6 +655,12 @@ PathmanCopyFrom(CopyState cstate, Relation parent_rel,
661
655
child_result_rel = rri_holder -> result_rel_info ;
662
656
estate -> es_result_relation_info = child_result_rel ;
663
657
658
+ /*
659
+ * Constraints might reference the tableoid column, so initialize
660
+ * t_tableOid before evaluating them.
661
+ */
662
+ tuple -> t_tableOid = RelationGetRelid (child_result_rel -> ri_RelationDesc );
663
+
664
664
/* If there's a transform map, rebuild the tuple */
665
665
if (rri_holder -> tuple_map )
666
666
{