PostgreSQL 19 ships pg_plan_advice, a contrib module that describes, captures, and enforces planner decisions from outside the query text. It is the first in-core mechanism for plan stabilization in the project's history.

The problem it addresses is statistical, not syntactic. ANALYZE estimates column distributions from a sample rather than a full scan. When the sample misrepresents the distribution, the planner costs the query wrong and can flip to a plan orders of magnitude slower, with no change to the query, the schema, or the data volume.

Clerk documented an instance on February 19, 2026: a column that was 99.9996% NULL, an automatic ANALYZE whose sample contained only NULLs, and a resulting plan that assumed zero non-null rows where there were over 17,000. The query ran frequently enough to saturate the database. Recovery took roughly 90 minutes, and the remediation was re-running ANALYZE until the sample came back different.

Until now the supported answer to that class of failure was to fix the statistics. PostgreSQL 19 adds a second one.

Why Postgres said no for so long