select open change scope Open full search

PG.CENTER connects PostgreSQL documentation, reference, and ecosystem knowledge. Maintained by Pigsty.

CONFIGURATION / REPORTING AND LOGGING

debug_pretty_print

Read PG 18 manual ↗

When set, debug_pretty_print indents the messages produced by debug_print_parse, debug_print_rewritten, or debug_print_plan.

Type
bool
Context
user
Measured default
on
Unit
Metadata snapshot
18

Definition PG 18 manual

When set, debug_pretty_print indents the messages produced by debug_print_parse, debug_print_rewritten, or debug_print_plan. This results in more readable but much longer output than the compact format used when it is off. It is on by default.

Measured default history
Version intervalDefault
9.0 – 19on
Analysis & operational context

Authored guidance from the GUC source snapshot; the version-specific manual above is the definition reference. View source ↗

How it works

debug_pretty_print indents parse and plan tree displays. It changes only the indentation of internal parse and plan tree dumps produced by the debug_print_* switches.

debug_pretty_print is a USER-context setting. An authorized role can change it for a session, while ALTER ROLE or ALTER DATABASE can establish a default for future sessions.

The debug_print_* switches feed the normal server logging path, so log_min_messages, log_destination, and collector capacity determine whether the output is retained safely.

Operational considerations

Changing debug_pretty_print in one session and assuming role defaults, database defaults, or other pooled sessions changed with it.

Leaving an internal-tree dump enabled globally and overwhelming log I/O, storage, or ingestion.

Treating debug output as a stable public format or as a substitute for targeted EXPLAIN diagnostics.

Changing debug_pretty_print globally without a rollback plan and a client or operational compatibility test.

Workload guidance

OLAP: Do not use debug_pretty_print as a substitute for EXPLAIN on analytical SQL; capture a targeted plan instead of dumping every internal tree.

OLTP: Do not tune or enable debug_pretty_print globally in production. If server-developer diagnostics require it, isolate one session, bound its duration, and route the resulting logs safely.

SMALL: Leave debug_pretty_print at its normal default. Verbose internal trees can exhaust a small node's log I/O and disk unexpectedly.

Version history 2
  1. PG 18 → 19changed
  2. PG 9.6 → 10changed

Related entries

Further reading

Definition snapshot: english-manuals:f57e7bd221a4bcd76f313fb0c7a… · English manual source