diff --git a/src/backend/executor/execProcnode.c b/src/backend/executor/execProcnode.c index 5662e7d742..01b7b926bf 100644 --- a/src/backend/executor/execProcnode.c +++ b/src/backend/executor/execProcnode.c @@ -755,8 +755,6 @@ ExecShutdownNode(PlanState *node) check_stack_depth(); - planstate_tree_walker(node, ExecShutdownNode, NULL); - /* * Treat the node as running while we shut it down, but only if it's run * at least once already. We don't expect much CPU consumption during @@ -770,6 +768,8 @@ ExecShutdownNode(PlanState *node) if (node->instrument && node->instrument->running) InstrStartNode(node->instrument); + planstate_tree_walker(node, ExecShutdownNode, NULL); + switch (nodeTag(node)) { case T_GatherState: