estate->es_direction = direction;
/*
- * If a tuple count was supplied or data is being written to relation, we
- * must force the plan to run without parallelism, because we might exit
- * early.
+ * If a tuple count was supplied, we must force the plan to run without
+ * parallelism, because we might exit early. Also disable parallelism
+ * when writing into a relation, because no database changes are allowed
+ * in parallel mode.
*/
if (numberTuples || dest->mydest == DestIntoRel)
use_parallel_mode = false;