diff --git a/src/backend/commands/functioncmds.c b/src/backend/commands/functioncmds.c index a997cb62642..016cdf20fb2 100644 --- a/src/backend/commands/functioncmds.c +++ b/src/backend/commands/functioncmds.c @@ -1489,6 +1489,8 @@ AlterFunction(ParseState *pstate, AlterFunctionStmt *stmt) procForm->prosupport = newsupport; } + if (parallel_item) + procForm->proparallel = interpret_func_parallel(parallel_item); if (set_items) { Datum datum; @@ -1523,8 +1525,7 @@ AlterFunction(ParseState *pstate, AlterFunctionStmt *stmt) tup = heap_modify_tuple(tup, RelationGetDescr(rel), repl_val, repl_null, repl_repl); } - if (parallel_item) - procForm->proparallel = interpret_func_parallel(parallel_item); + /* DO NOT put more touches of procForm below here; it's now dangling. */ /* Do the update */ CatalogTupleUpdate(rel, &tup->t_self, tup);