PostgreSQL 19 shipped yesterday, and the headline feature is one that every backend engineer dealing with table bloat has wanted for years: REPACK, a native command that rebuilds bloated tables without the full-table lock that made VACUUM FULL a production hazard. That alone is worth the upgrade. But Postgres 19 also ships native query plan hints after the project refused to add them for two decades, closes the sequence replication gap that caused duplicate-key failures on promoted standbys, and buries PostgreSQL 14 — which went end-of-life on November 12.
REPACK: The Feature pg_repack Users Have Been Waiting For
Table bloat — where dead tuples accumulate and swell table size — has always been a problem for high-write Postgres deployments. The standard fix, VACUUM FULL, acquires an ACCESS EXCLUSIVE lock for the entire rebuild, blocking every read and write until it finishes. Teams running busy production databases have been routing around this with pg_repack, a third-party extension, for years.
PostgreSQL 19 makes it native. The new REPACK command holds a SHARE UPDATE EXCLUSIVE lock — the same level as VACUUM and ANALYZE — for the bulk of the rebuild, then acquires an exclusive lock only during the final swap. The practical difference is dramatic: in a test with eight concurrent writers, VACUUM FULL let through 33 writes during the operation; REPACK let through 3,988.
-- Live rebuild with brief swap lock only
REPACK TABLE orders CONCURRENTLY;
-- Full rebuild, still blocks, but no third-party dependency
REPACK TABLE orders;
There is a caveat to know before you run REPACK CONCURRENTLY in production: it is not MVCC-safe. Any transaction holding a snapshot taken before the repack started — including a concurrent pg_dump — may see the table as empty after the swap. The PostgreSQL documentation is clear: treat REPACK CONCURRENTLY as planned maintenance, not a harmless background operation. That said, for the typical use case — running it in a maintenance window without an active pg_dump — it is a significant improvement over what came before.
pg_plan_advice: Postgres Finally Ships Query Hints
For twenty years, PostgreSQL’s answer to “can I hint the query planner?” was no. The project’s position was that query hints are a workaround for schema and statistics problems, not a solution. That position was intellectually defensible and also occasionally infuriating for teams managing complex analytics queries that regressed after a planner update.
PostgreSQL 19 ships pg_plan_advice, a native query hint extension. The design is pragmatic: advice lives outside SQL — in a GUC or the companion pg_stash_advice module — so it does not pollute your query text. The workflow is straightforward:
-- Get the current plan written as advice
EXPLAIN (COSTS OFF, PLAN_ADVICE)
SELECT * FROM orders o JOIN customers c ON c.id = o.customer_id;
-- Apply a known-good plan
SET pg_plan_advice.advice = 'JOIN_ORDER(c o) INDEX_SCAN(o idx_orders_customer)';
-- Reset when done
RESET pg_plan_advice.advice;
The feedback mechanism is what makes this worth using: pg_plan_advice tells you whether each hint was honored, partially matched, or silently ignored, along with reasons. That is a material improvement over the black-box behavior of similar tools in other databases.
This matters especially for Postgres 19 specifically, because the new anti-join optimization in the planner can cause regressions on analytics queries — a 100ms index scan can become a 2-second join depending on your statistics. pg_plan_advice gives you a controlled way to stabilize plans while you investigate. See the Neon pg_plan_advice guide for the full option reference.
Sequence Replication and Read-Your-Writes on Standbys
Logical replication in previous Postgres versions had a well-known gap: sequences were not replicated. When a subscriber was promoted after a failover, its sequences were frozen at the values they held when the subscription started — causing duplicate-key errors as the new primary generated IDs that already existed in the data.
PostgreSQL 19 fixes this. Include sequences in a publication with FOR ALL SEQUENCES, and REFRESH SEQUENCES advances existing subscriptions to the publisher’s current state. The release also adds WAIT FOR LSN, enabling read-your-writes consistency on standbys — a session can wait until the standby replays WAL to a specific log sequence number before querying:
-- Publish sequences along with tables
CREATE PUBLICATION my_pub FOR ALL TABLES, ALL SEQUENCES;
-- On standby: wait for a specific write to be visible, then read
WAIT FOR LSN '0/15E9D18';
SELECT * FROM orders WHERE id = 42;
One constraint: WAIT FOR LSN cannot run inside a REPEATABLE READ transaction that already holds a snapshot.
Parallel Autovacuum and SNI TLS
Two operational improvements round out the release. Autovacuum can now vacuum indexes using parallel workers via autovacuum_max_parallel_workers (off by default; set to 2 or 4 to enable). Benchmarks show roughly 23% faster autovacuum runs on write-heavy tables with many indexes. A new scoring system also ensures autovacuum prioritizes the most bloated tables first.
PostgreSQL 19 also adds SNI support: a single Postgres instance can now present different TLS certificates per hostname via pg_hosts.conf. If you are running a multi-tenant deployment or a service fronting many customers, this removes the need for a TLS-terminating proxy or multiple server instances to handle per-customer certificates.
Upgrade Guide: PostgreSQL 14 Is EOL, Watch the Changed Defaults
If you are running PostgreSQL 14, the urgency is real: it reached end-of-life on November 12 and will receive no further security patches. The official release announcement covers supported upgrade paths (pg_upgrade, dump/restore, logical replication). Before you cut over to 19, review these changed defaults:
- JIT is now off by default. If your workload relied on JIT, re-enable it explicitly.
max_locks_per_transactiondoubles to 128. Custom lower values need adjustment.- Anti-join planner changes are a regression risk. Test analytics queries against a staging instance. Use
pg_plan_adviceto stabilize any regressions. btree_gistinet/cidr indexes and line breaks in database or role names will causepg_upgradeto fail. Runpg_upgrade --checkon a copy before attempting the real upgrade.
The practical timeline: get off PostgreSQL 14 this quarter, test 19 in staging now, and schedule the production migration for early 2027 after the first point release. The AI-assisted code review that surfaced 74% more bugs during 19’s development cycle is continuing — expect 19.1 to arrive with a solid batch of fixes.

