Skip to content

Commit 4dd25a9

Browse files
committed
Fix table_oid assign in COPY
1 parent 7ae45b5 commit 4dd25a9

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

src/utility_stmt_hooking.c

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -632,12 +632,6 @@ PathmanCopyFrom(CopyState cstate, Relation parent_rel,
632632
if (tuple_oid != InvalidOid)
633633
HeapTupleSetOid(tuple, tuple_oid);
634634

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-
641635
/* Place tuple in tuple slot --- but slot shouldn't free it */
642636
slot = myslot;
643637
ExecStoreTuple(tuple, slot, InvalidBuffer, false);
@@ -661,6 +655,12 @@ PathmanCopyFrom(CopyState cstate, Relation parent_rel,
661655
child_result_rel = rri_holder->result_rel_info;
662656
estate->es_result_relation_info = child_result_rel;
663657

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+
664664
/* If there's a transform map, rebuild the tuple */
665665
if (rri_holder->tuple_map)
666666
{

0 commit comments

Comments
 (0)