diff options
Diffstat (limited to 'src/backend/commands/copy.c')
-rw-r--r-- | src/backend/commands/copy.c | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/src/backend/commands/copy.c b/src/backend/commands/copy.c index 4562a5121d4..a42861da0df 100644 --- a/src/backend/commands/copy.c +++ b/src/backend/commands/copy.c @@ -2633,13 +2633,12 @@ CopyFrom(CopyState cstate) if (cstate->transition_capture != NULL) { if (resultRelInfo->ri_TrigDesc && - (resultRelInfo->ri_TrigDesc->trig_insert_before_row || - resultRelInfo->ri_TrigDesc->trig_insert_instead_row)) + resultRelInfo->ri_TrigDesc->trig_insert_before_row) { /* - * If there are any BEFORE or INSTEAD triggers on the - * partition, we'll have to be ready to convert their - * result back to tuplestore format. + * If there are any BEFORE triggers on the partition, + * we'll have to be ready to convert their result back to + * tuplestore format. */ cstate->transition_capture->tcs_original_insert_tuple = NULL; cstate->transition_capture->tcs_map = @@ -2768,12 +2767,13 @@ CopyFrom(CopyState cstate) * tuples inserted by an INSERT command. */ processed++; + } - if (saved_resultRelInfo) - { - resultRelInfo = saved_resultRelInfo; - estate->es_result_relation_info = resultRelInfo; - } + /* Restore the saved ResultRelInfo */ + if (saved_resultRelInfo) + { + resultRelInfo = saved_resultRelInfo; + estate->es_result_relation_info = resultRelInfo; } } |