diff --git a/src/backend/commands/explain.c b/src/backend/commands/explain.c index ee13136..d589b0d 100644 --- a/src/backend/commands/explain.c +++ b/src/backend/commands/explain.c @@ -346,8 +346,12 @@ ExplainOneQuery(Query *query, IntoClause *into, ExplainState *es, INSTR_TIME_SET_CURRENT(planstart); - /* plan the query */ - plan = pg_plan_query(query, CURSOR_OPT_PARALLEL_OK, params); + /* + * plan the query. + * Note: If Explain is for CreateTableAs / SelectInto Avoid parallel + * plans. + */ + plan = pg_plan_query(query, into ? 0:CURSOR_OPT_PARALLEL_OK, params); INSTR_TIME_SET_CURRENT(planduration); INSTR_TIME_SUBTRACT(planduration, planstart);