# operator_precedence_warning

> operator_precedence_warning — Emit a warning for constructs that changed meaning since PostgreSQL 9.4. Observed in PG9.5–13; its last measured boot default is off in PG13, with user context. It was removed in PG14.
---

> [!NOTE]
> **Fact — official short description:** “Emit a warning for constructs that changed meaning since PostgreSQL 9.4.”

## 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 | Version and Platform Compatibility / Previous PostgreSQL Versions | Upstream classification |
| Latest boot value | `off` | off |
{.fields meta="-"}

## Lifecycle {#lifecycle}

| Fact | Value |
| --- | --- |
| First observed | PG9.5 |
| Present in | PG9.5–13 |
| Removed in | PG14 |
| Introduction commit | [`c6b3c939b7e0`](https://git.postgresql.org/gitweb/?p=postgresql.git;a=commit;h=c6b3c939b7e0f1d35f4ed4996e71420a993810d2) — Make operator precedence follow the SQL standard more closely. |
| Commit date | 2015-03-11 |
| Discussion | — |

## Default history {#default-history}

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

## How it works {#mechanism}

Emit a warning for constructs that changed meaning since PostgreSQL 9.4. The parameter still exists in PG13 and is no longer recognized from PG14. PostgreSQL 14 removed the migration warning; rewrite ambiguous expressions with explicit parentheses and test them on the target release.

This emitted migration warnings for expressions whose operator binding changed in PostgreSQL 9.5. It never restored old precedence, and after its removal the durable fix is explicit parentheses plus regression tests.

Before upgrading, inspect default_with_oids, lo_compat_privileges, synchronize_seqscans, remove the old name from configuration, ALTER SYSTEM, role/database settings, and automation templates, and verify the replacement before starting PG14 or later.

## 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 continue emitting operator_precedence_warning on PG14+. PostgreSQL 14 removed the migration warning; rewrite ambiguous expressions with explicit parentheses and test them on the target release. Scan every configuration layer and regression-test the application before upgrade. |
| OLAP | Use the same migration path as OLTP, and also verify long batches, standbys, or large-object/extension workflows; removal of the old switch does not promise identical legacy behavior. |
| Small nodes | Delete the obsolete setting and adopt the supported replacement directly; do not emulate legacy behavior in scripts without a demonstrated compatibility requirement. |
{.full-width}

## Pigsty {#pigsty}

Values use the fixed 8-vCPU, 32-GiB, 100-GiB SSD fixture and render the current Pigsty templates for PG13; 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.5–13 unmodified; OLAP: PG9.5–13 unmodified; CRIT: PG9.5–13 unmodified; TINY: PG9.5–13 unmodified. No Pigsty-specific rationale is inferred from an absent override.

## Common pitfalls {#common-pitfalls}

- Continuing to emit unknown parameter operator_precedence_warning on PG14+.
- Deleting only the setting name without migrating dependent application behavior.
- Assuming the historical default equals the replacement mechanism's default.
- Missing stale entries in ALTER SYSTEM, role/database settings, or automation templates.

## Related parameters {#related-parameters}

[`default_with_oids`](/parameters/default-with-oids/) · [`lo_compat_privileges`](/parameters/lo-compat-privileges/) · [`synchronize_seqscans`](/parameters/synchronize-seqscans/) · [`standard_conforming_strings`](/parameters/standard-conforming-strings/) · [`array_nulls`](/parameters/array-nulls/) · [`backslash_quote`](/parameters/backslash-quote/)

## References {#references}

- [PostgreSQL 13 — operator_precedence_warning](https://www.postgresql.org/docs/13/runtime-config-compatible.html#GUC-OPERATOR-PRECEDENCE-WARNING)
- [Machine-readable GUC export](/data/guc.jsonl)
