debug_pretty_print

A GUC controlling whether to format the output of debug_print_parse, debug_print_rewritten and debug_print_plan

debug_pretty_print is GUC controlling whether to format the output of debug_print_parse, debug_print_rewritten and debug_print_plan.

debug_pretty_print was added in PostgreSQL 7.1 (commit 6a68f426).

Default

Default value for debug_pretty_print is: on

Notes

As far as it's possible to ascertain, debug_pretty_print was added in feature commit (commit 6a68f426), in which PostgreSQL's Grand Unified Configuration system was introduced.

Examples

Sample output with an arbitrary query debug_pretty_print set to off:

[2020-08-16 15:19:33 UTC] psql postgres postgres LOG:  00000: statement: SELECT 1;
[2020-08-16 15:19:33 UTC] psql postgres postgres LOCATION:  exec_simple_query, postgres.c:1044
[2020-08-16 15:19:33 UTC] psql postgres postgres LOG:  00000: plan:
[2020-08-16 15:19:33 UTC] psql postgres postgres DETAIL:  {PLANNEDSTMT :commandType 1 :queryId 0 :hasReturning false :hasModifyingCTE
	false :canSetTag true :transientPlan false :dependsOnRole false
	:parallelModeNeeded false :jitFlags 0 :planTree {RESULT :startup_cost 0.00
	:total_cost 0.01 :plan_rows 1 :plan_width 4 :parallel_aware false
	:parallel_safe false :plan_node_id 0 :targetlist ({TARGETENTRY :expr {CONST
	:consttype 23 :consttypmod -1 :constcollid 0 :constlen 4 :constbyval true
	:constisnull false :location 7 :constvalue 4 [ 1 0 0 0 0 0 0 0 ]} :resno 1
	:resname ?column? :ressortgroupref 0 :resorigtbl 0 :resorigcol 0 :resjunk
	false}) :qual <> :lefttree <> :righttree <> :initPlan <> :extParam (b)
	:allParam (b) :resconstantqual <>} :rtable ({RTE :alias <> :eref {ALIAS
	:aliasname *RESULT* :colnames <>} :rtekind 8 :lateral false :inh false
	:inFromCl false :requiredPerms 0 :checkAsUser 0 :selectedCols (b)
	:insertedCols (b) :updatedCols (b) :extraUpdatedCols (b) :securityQuals <>})
	:resultRelations <> :rootResultRelations <> :appendRelations <> :subplans <>
	:rewindPlanIDs (b) :rowMarks <> :relationOids <> :invalItems <>
	:paramExecTypes <> :utilityStmt <> :stmt_location 0 :stmt_len 8}
	
[2020-08-16 15:19:33 UTC] psql postgres postgres LOCATION:  elog_node_display, print.c:85

Sample output from an arbitrary query with debug_pretty_print set to on (the default):

2020-08-16 15:19:16 UTC] psql postgres postgres LOG:  00000: statement: SELECT 1;
[2020-08-16 15:19:16 UTC] psql postgres postgres LOCATION:  exec_simple_query, postgres.c:1044
[2020-08-16 15:19:16 UTC] psql postgres postgres LOG:  00000: plan:
[2020-08-16 15:19:16 UTC] psql postgres postgres DETAIL:     {PLANNEDSTMT 
	   :commandType 1 
	   :queryId 0 
	   :hasReturning false 
	   :hasModifyingCTE false 
	   :canSetTag true 
	   :transientPlan false 
	   :dependsOnRole false 
	   :parallelModeNeeded false 
	   :jitFlags 0 
	   :planTree 
	      {RESULT 
	      :startup_cost 0.00 
	      :total_cost 0.01 
	      :plan_rows 1 
	      :plan_width 4 
	      :parallel_aware false 
	      :parallel_safe false 
	      :plan_node_id 0 
	      :targetlist (
	         {TARGETENTRY 
	         :expr 
	            {CONST 
	            :consttype 23 
	            :consttypmod -1 
	            :constcollid 0 
	            :constlen 4 
	            :constbyval true 
	            :constisnull false 
	            :location 7 
	            :constvalue 4 [ 1 0 0 0 0 0 0 0 ]
	            }
	         :resno 1 
	         :resname ?column? 
	         :ressortgroupref 0 
	         :resorigtbl 0 
	         :resorigcol 0 
	         :resjunk false
	         }
	      )
	      :qual <> 
	      :lefttree <> 
	      :righttree <> 
	      :initPlan <> 
	      :extParam (b)
	      :allParam (b)
	      :resconstantqual <>
	      }
	   :rtable (
	      {RTE 
	      :alias <> 
	      :eref 
	         {ALIAS 
	         :aliasname *RESULT* 
	         :colnames <>
	         }
	      :rtekind 8 
	      :lateral false 
	      :inh false 
	      :inFromCl false 
	      :requiredPerms 0 
	      :checkAsUser 0 
	      :selectedCols (b)
	      :insertedCols (b)
	      :updatedCols (b)
	      :extraUpdatedCols (b)
	      :securityQuals <>
	      }
	   )
	   :resultRelations <> 
	   :rootResultRelations <> 
	   :appendRelations <> 
	   :subplans <> 
	   :rewindPlanIDs (b)
	   :rowMarks <> 
	   :relationOids <> 
	   :invalItems <> 
	   :paramExecTypes <> 
	   :utilityStmt <> 
	   :stmt_location 0 
	   :stmt_len 8
	   }
	
[2020-08-16 15:19:16 UTC] psql postgres postgres LOCATION:  elog_node_display, print.c:85

Categories

GUC configuration item, Logging, PostgreSQL internals

See also

debug_print_parse, debug_print_rewritten, debug_print_plan