Skip to content

debug_pretty_print

debug_pretty_print is the PostgreSQL setting that indents parse and plan tree displays.
Note

Fact — official short description: “Indents parse and plan tree displays.”

Identity

Type , Valuebool
Upstream pg_settings type
Context , Valueuser
Settable by an ordinary user
Unit , Value—
Raw unit
Range , Value—
Raw limits in the last observed version
Enum values , Value—
— for non-enum types
Category , ValueReporting and Logging / What to Log
Upstream classification
Latest boot value , Valueon
on

Lifecycle

Fact Value
First observed PG9.0 (research boundary)
Present in PG9.0–19 Beta 3
Removed in No
Introduction commit Not asserted: predates the PG9.0 research boundary
Commit date —
Discussion —

Default history

Measured PG9.0–19 Beta 3 boot defaults
Versions Raw boot_val Unit Human value
PG9.0–19 Beta 3 on — on

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.

Tuning advice

Tip

Advice. These are workload-specific starting points and must be validated with measurements.

Workload Guidance
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.
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.
Small nodes Leave debug_pretty_print at its normal default. Verbose internal trees can exhaust a small node’s log I/O and disk unexpectedly.

Pigsty

Values use the fixed 8-vCPU, 32-GiB, 100-GiB SSD fixture and render the current Pigsty templates for PG19 Beta 3; this does not assert current Pigsty support for that historical or beta release.

Template Effective value Versus upstream boot Source expression
OLTP Unmodified — —
OLAP Unmodified — —
CRIT Unmodified — —
TINY Unmodified — —
Caution

Advice — pending human review. Fact from the current Pigsty template projection: OLTP: PG9.0–19 Beta 3 unmodified; OLAP: PG9.0–19 Beta 3 unmodified; CRIT: PG9.0–19 Beta 3 unmodified; TINY: PG9.0–19 Beta 3 unmodified. No Pigsty-specific rationale is inferred from an absent override.

Common pitfalls

  • 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.

debug_print_parse · debug_print_plan · debug_print_rewritten · log_min_messages · client_min_messages

References