Parameter · Reporting and Logging / What to Log
debug_print_plan
Logs each query's execution plan.
- Default:
off - Type: bool
- Applies: Session (any user)
In plain words
Writes the complete internal plan that the executor will run, in PostgreSQL's node format. EXPLAIN shows the same plan in readable form; this shows every internal field, which only developers usually need.
For DBAs and operators
Printed as LOG: plan: with a PLANNEDSTMT node (captured with debug_pretty_print = off):
Shows things EXPLAIN hides: plan_node_id, parallel_safe flags, param IDs, relationOids and invalItems used for plan-cache invalidation. Since PostgreSQL 18 nodes carry disabled_nodes (also visible as "Disabled: true" in EXPLAIN). For production investigation prefer auto_explain with log_verbose, which is readable and can be limited by duration.
How to change it
Any user can change it for their session with SET.