select open change scope Open full search

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

CONFIGURATION / REPORTING AND LOGGING

debug_print_parse

Read PG 18 manual ↗

These parameters enable various debugging output to be emitted.

Type
bool
Context
user
Measured default
off
Unit
Metadata snapshot
18

Definition PG 18 manual

These parameters enable various debugging output to be emitted. When set, they print the resulting parse tree, the query rewriter output, or the execution plan for each executed query. These messages are emitted at LOG message level, so by default they will appear in the server log but will not be sent to the client. You can change that by adjusting client_min_messages and/or log_min_messages. These parameters are off by default.

Measured default history
Version intervalDefault
9.0 – 19off
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_print_parse logs each query's parse tree. The output is PostgreSQL's internal parse-tree representation for every parsed query, not normalized SQL text.

debug_print_parse 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_print_parse 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_print_parse globally without a rollback plan and a client or operational compatibility test.

Workload guidance

OLAP: Do not use debug_print_parse 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_print_parse globally in production. If server-developer diagnostics require it, isolate one session, bound its duration, and route the resulting logs safely.

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

Version history 1
  1. PG 18 → 19changed

Related entries

Further reading

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