wasl.tech

PostgreSQL 19 Is Here: REPACK, Plan Advice and Faster Maintenance

PostgreSQL 19 Brings REPACK, the Command DBAs Have Waited Years For

It is two in the morning, and the database administrator is staring at a maintenance window that is shrinking by the minute. The busiest table in the system has grown fat with dead rows, queries are dragging, and the only fix on offer is a command that locks the table and stops the application cold. Every database team knows this scene. PostgreSQL 19, released on November 19, 2026, is built to make it rarer.

The new version arrives in the project’s 30th year, and its headline features all point in the same direction: maintenance that happens while the application keeps running, and query plans that stay steady instead of drifting. The star of the release is a brand-new command called REPACK, joined by a planner-advice system, a smarter autovacuum and replication upgrades that remove one of the oldest annoyances in the book.

PostgreSQL 19 is available now from postgresql.org, and the release notes run to hundreds of changes. Here is what matters, and what to watch before you upgrade.

REPACK: Clean Up a Table Without Taking It Offline

Over time, every busy table in PostgreSQL accumulates bloat. Rows are updated and deleted, dead space piles up, and the table grows larger than the live data inside it. Until now, reclaiming that space meant choosing between two blunt tools: VACUUM FULL, which rewrites the table behind an exclusive lock, or CLUSTER, which rebuilds it in index order and locks it too. Both work, and both stop the application.

REPACK folds both jobs into a single command. Run it plainly and it rewrites the table, reclaiming wasted space and optionally reorganising rows by an index. Run it as REPACK (CONCURRENTLY) and reads and writes keep flowing through nearly the whole rebuild, with only a brief exclusive lock for the final swap. The old commands are still there for compatibility, but for most teams they just became the fallback.

There is one sharp edge to know about. Transactions whose snapshots were taken before a repack began can see the table as empty afterwards, a quirk of how PostgreSQL handles visibility during the rewrite. It is documented, and it is the kind of detail worth reading twice before running REPACK on a table that long-running reports depend on.

PostgreSQL 19 Plan Advice: Taming the Query Planner

The second headline feature is for anyone who has watched a query suddenly slow down after an upgrade or a surge in data. PostgreSQL’s planner usually picks good execution plans, but occasionally it picks a bad one, and a single bad plan on a critical query can ruin a morning. Fixing it has traditionally meant rewriting SQL, adding hints through extensions, or living with it.

PostgreSQL 19 brings the answer into the core. The new pg_plan_advice extension captures a planner decision — the join order, the scan method, the choices that made a plan fast — as an advice string. A companion extension, pg_stash_advice, stores that advice against a query and applies it automatically whenever the query runs again. A proven plan can now survive upgrades and data growth without a single change to application code.

Used carelessly, the same power can freeze a plan that should have changed, so the feature rewards a light touch. Pin the handful of queries that genuinely matter, and leave the rest of the planner alone. The tooling is there to describe, reproduce and constrain decisions; judgement is still the operator’s job.

Autovacuum Finally Keeps Up

Autovacuum is the quiet janitor of every PostgreSQL cluster, cleaning up dead rows in the background. On large systems it has long struggled to keep pace, especially when indexes need vacuuming. PostgreSQL 19 lets autovacuum use parallel workers for index vacuuming and cleanup, so maintenance that used to queue up can now run side by side.

A new scoring system decides which tables get attention first, and a view called pg_stat_autovacuum_scores exposes those priorities so operators can see what the janitor is thinking. The release also makes I/O worker processes scale automatically, replacing the old single io_workers setting with minimum and maximum bounds. Foreign-key checks get quicker too, and the planner can now turn some NOT IN clauses into faster anti-joins when it knows no NULLs are involved.

Two new system views close long-standing blind spots. pg_stat_lock collects cluster-wide lock counters, including waits and fast-path slot exhaustion, and log_lock_waits is switched on by default, so long lock waits are logged without anyone remembering to enable it. pg_stat_recovery gathers replay positions, timelines, promotion state and the last replayed transaction timestamp for standbys into one place.

Replication Without the Restart

Logical replication gets two changes that will matter most on busy clusters. First, it can now be switched on without restarting the server, as long as wal_level is set to replica. Anyone who has ever scheduled a restart just to flip a replication setting will feel the relief in that sentence.

Second, sequence values can now travel from publisher to subscriber. When a subscription is created, sequences can synchronise as part of the initial copy, and ALTER SUBSCRIPTION … REFRESH SEQUENCES resynchronises them later. Migrations and cutovers get smoother, because a sequence that restarts at one on the new system is the kind of bug that only shows up in production, at the worst moment.

There is also a new WAIT command for a classic replica problem. Writing to the primary and immediately reading from an asynchronous standby can return stale data, because the standby has not replayed the write yet. WAIT lets the reader hold until replay reaches a given log position, giving applications read-your-writes consistency on standbys without forcing the whole cluster into synchronous replication.

The Fine Print: What Changes When You Upgrade

Every major PostgreSQL release carries breaking changes, and version 19 is no exception. Just-in-time compilation now ships disabled by default, so analytical workloads that benefited from it should be tested and switched on deliberately. The default for max_locks_per_transaction rises from 64 to 128. RADIUS authentication is gone, standard_conforming_strings is always on, and indexes on inet and cidr columns move to GiST — pg_upgrade will refuse clusters carrying btree_gist indexes on those types.

A few features that appeared in beta did not make the final cut. SQL property graph queries, partition merging and splitting, online checksum toggling and a set of DDL extraction functions were all reverted before release. If you were tracking any of them, they are not in this version.

The upgrade clock is also ticking for anyone still on older versions. PostgreSQL 14 reached its end of support on November 12, 2026, with version 14.24 as its final release, so clusters on 14 no longer receive fixes. The path forward runs through pg_upgrade or a dump and restore, and the release notes are blunt about checking the incompatibilities first.

What Happens Next

For developers, the smaller conveniences may be the ones they notice first. Upserts can now return existing rows with ON CONFLICT DO SELECT, and window functions support IGNORE NULLS. OAuth handling is refined too, with different validator settings for different groups of users, building on the support introduced in version 18.

Enterprise support is already lined up. EDB, the company behind much of the release’s headline work, began supporting PostgreSQL 19 on release day, and its enterprise servers will ship the version in February 2027. The weights of the release — the downloads, the hosted options, the cloud images — follow the usual channels, with the source and binaries available from the project’s own site.

PostgreSQL has spent three decades growing from a university research project into the default open-source database for much of the web, and version 19 keeps that trajectory: less downtime, steadier plans, fewer surprises. The maintenance window at two in the morning is not gone, but for the first time, the database itself is trying to make it shorter.

For the full list of changes, see the PostgreSQL 19 release notes. And if your infrastructure depends on other open-source projects, the same week brought an open-source inference alliance from Nvidia, AMD, Intel and Google behind SGLang, while NVIDIA’s OpenShell joined the CNCF — and the NGINX2Root flaws remain a reminder to patch the stack around the database too.

Leave a Comment

Your email address will not be published. Required fields are marked *

Scroll to Top