Clearing bloat from a large table no longer means locking it for minutes or hours. PostgreSQL 19, released on 19 November 2026, ships REPACK (CONCURRENTLY), which rewrites a table without blocking reads or writes. It also brings a way to pin query plans without touching application code, read-your-writes consistency on standbys, and a list of breaking changes worth reading before you upgrade.
The features that change day-to-day work
REPACK replaces VACUUM FULL and CLUSTER. Until now, reclaiming space from a table with heavy updates and deletes meant holding an ACCESS EXCLUSIVE lock for the whole operation. REPACK does the same job (and can reorder rows to match an index), and with CONCURRENTLY it does it without cutting off traffic. The two old commands remain for compatibility.
-- Rewrite the table following its previous clustering index, without blocking
REPACK (CONCURRENTLY) orders USING INDEX;Stable plans with pg_plan_advice and pg_stash_advice. The classic "this query was fine yesterday, today the planner picked a different plan" incident finally has an answer inside PostgreSQL itself. pg_plan_advice lets you pin or experiment with planner choices through a small "plan advice" language, and pg_stash_advice stores that advice and applies it automatically by query identifier. In other words, you can fix a slow plan without shipping new code.
Read on the replica what you just wrote. Anyone routing reads to standbys knows the bug: a user saves a change and the next request doesn't show it because the replica is a few milliseconds behind. The new WAIT FOR LSN handles that read-your-writes pattern: the app keeps the WAL position after writing to the primary and, before reading from the standby, waits until it has been replayed there.
-- On the primary, right after the write
SELECT pg_current_wal_insert_lsn(); -- e.g. 0/0306EE20
-- On the standby, before reading; without TIMEOUT it would wait forever
WAIT FOR LSN '0/0306EE20' WITH (TIMEOUT '100ms', NO_THROW);With NO_THROW it returns success or timeout instead of raising an error, so the application can decide whether to retry or fall back to the primary.
Logical replication without a restart. Creating the first logical replication slot now raises the effective WAL level to logical automatically when it was set to replica; effective_wal_level shows the value in use. Sequences are finally replicated too (CREATE PUBLICATION ... FOR ALL SEQUENCES), which removes a long-standing pain point in logical-replication migrations.
Faster without changing anything. Foreign key checks are quicker (bulk inserts were nearly 2x faster in the project's testing), NOT IN becomes an anti-join when no NULLs are present, and autovacuum processes indexes with parallel workers and ranks tables with a scoring system you can inspect in pg_stat_autovacuum_scores. Developers get niceties such as INSERT ... ON CONFLICT DO SELECT, which returns the existing row and saves the extra round trip in "get or create", plus JSON output for COPY.
What can break
The incompatibility list is long; these are the items most likely to bite:
- JIT is off by default. Its cost estimates proved unreliable. If you run heavy analytical queries, benchmark before and after and turn it back on if you miss it.
max_locks_per_transactiongoes from 64 to 128, but lock memory is sized differently now: if you had tuned it, double your value to keep the same capacity.io_workersis gone, replaced by settings includingio_min_workersandio_max_workers, which scale I/O workers automatically. Anypostgresql.confthat setsio_workersneeds attention.- RADIUS is removed, and every md5 password login now logs a warning (md5 was deprecated in 18). Time to move to SCRAM.
standard_conforming_stringsis always on. Dumps made by an olderpg_dumpwith that settingoffwon't load correctly: take the dump with the 19pg_dump.pg_upgraderefuses clusters withbtree_gistindexes oninet/cidr(they could drop rows that should match) or database, role or tablespace names containing line breaks.- Reindex after upgrading full text search and
pg_trgmindexes in databases using the ICU or builtin locale provider, because character classification changes. - Monitoring:
sync_error_countbecomessync_table_error_countinpg_stat_subscription_stats, and several buffer wait events were renamed. Check your dashboards and alerts.
How to upgrade to PostgreSQL 19
It's a major release, so you need pg_dumpall, pg_upgrade or logical replication. With pg_upgrade, always run the new version's binary and start with --check, which validates both clusters without touching data (paths follow a Debian/Ubuntu package install):
# With both servers stopped, as the postgres user
/usr/lib/postgresql/19/bin/pg_upgrade \
--old-bindir=/usr/lib/postgresql/18/bin \
--new-bindir=/usr/lib/postgresql/19/bin \
--old-datadir=/var/lib/postgresql/18/main \
--new-datadir=/var/lib/postgresql/19/main \
--jobs=4 --check
# If the check passes, run it again without --check (add --link to avoid copying files)--link skips copying files and is much faster, but once you start the new cluster you can't go back to the old one. After the upgrade, the docs ask you to regenerate statistics:
vacuumdb --all --analyze-in-stages --missing-stats-only --jobs=4
vacuumdb --all --analyze-only --jobs=4For containers, the official image already publishes postgres:19, postgres:19-trixie and postgres:19-alpine. Bumping the image tag doesn't migrate an 18 data directory, though: you still need pg_upgrade or a dump.
Pre-production checklist
- Run
pg_upgrade --checkagainst a copy of the real cluster and fix whatever it flags. - Search
postgresql.confforio_workersandmax_locks_per_transaction, andpg_hba.conffor RADIUS or md5. - Time your analytical queries with and without JIT before accepting the new default.
- Update dashboards that read
pg_stat_subscription_statsor buffer wait events. - If you use ICU or builtin locales with text search or
pg_trgm, schedule theREINDEXinside the window. - Try
REPACK (CONCURRENTLY)on a genuinely bloated table in staging before retiring yourVACUUM FULLscripts.
My take: REPACK (CONCURRENTLY) and pg_stash_advice go after two of the problems that cause the most PostgreSQL pages: maintenance that blocks and plans that change without warning. That makes 19 worth testing now, even if production waits for the first minor release.
Sources
- PostgreSQL 19 Released!, PostgreSQL Global Development Group, 19 November 2026.
- PostgreSQL 19 release notes, including "Migration to Version 19".
- pg_upgrade documentation.
- WAIT FOR LSN documentation.
- Official PostgreSQL image on Docker Hub.