# debug_print_parse

> debug_print_parse is the PostgreSQL setting that controls whether PostgreSQL logs each query's parse tree.
---

> [!NOTE]
> **Fact — official short description:** “Logs each query's parse tree.”

## Identity {#identity}

| Field | Value | Meaning |
| --- | --- | --- |
| Type | `bool` | Upstream pg_settings type |
| Context | `user` | Settable by an ordinary user |
| Unit | — | Raw unit |
| Range | — | Raw limits in the last observed version |
| Enum values | — | — for non-enum types |
| Category | Reporting and Logging / What to Log | Upstream classification |
| Latest boot value | `off` | off |
{.fields meta="-"}

## Lifecycle {#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 {#default-history}

| Versions | Raw `boot_val` | Unit | Human value |
| --- | --- | --- | --- |
| PG9.0–19 Beta 3 | `off` | — | off |
{.full-width caption="Measured PG9.0–19 Beta 3 boot defaults"}

## How it works {#mechanism}

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.

## Tuning advice {#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_print_parse 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_print_parse as a substitute for EXPLAIN on analytical SQL; capture a targeted plan instead of dumping every internal tree. |
| Small nodes | Leave debug_print_parse at its normal default. Verbose internal trees can exhaust a small node's log I/O and disk unexpectedly. |
{.full-width}

## Pigsty {#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 | — | — |
{.full-width}

> [!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 {#common-pitfalls}

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

## Related parameters {#related-parameters}

[`debug_pretty_print`](/parameters/debug-pretty-print/) · [`debug_print_plan`](/parameters/debug-print-plan/) · [`debug_print_rewritten`](/parameters/debug-print-rewritten/) · [`log_min_messages`](/parameters/log-min-messages/) · [`client_min_messages`](/parameters/client-min-messages/)

## References {#references}

- [PostgreSQL 19 Beta 3 — debug_print_parse](https://www.postgresql.org/docs/18/runtime-config-logging.html#GUC-DEBUG-PRINT-PARSE)
- [PostgreSQL 19 release notes](https://www.postgresql.org/docs/19/release-19.html)
- [Machine-readable GUC export](/data/guc.jsonl)
