PostgreSQL 19 shipped on November 19, 2026 — RC1 was announced October 15, features are frozen, release notes are out. This is a rare release that changes not “another couple percent in the planner” but operational routine: online repacking of bloated tables, async I/O, and parallel autovacuum. Below — a no-marketing breakdown: what to take to production right away, what to hold until 19.1, and how to build an upgrade that doesn’t turn into a nightly drama series.
Table of contents
Open Table of contents
Three themes that matter to an ops engineer
Three things in nineteen hit operations pain dead-on:
- REPACK — a new built-in command replacing
VACUUM FULLandCLUSTER, with an onlineREPACK (CONCURRENTLY)mode that doesn’t block reads or writes. - Async I/O grew up —
io_methodarrived back in 18, but in 19 the workers auto-scale, read-ahead for large reads works better, and I/O activity became visible inEXPLAIN. - Autovacuum is parallel and prioritized — indexes are cleaned by concurrent workers, and table order is computed by a tunable scoring system.
There’s also a layer of breaking changes — few, but with a couple of surprises (JIT is now off by default). Let’s go through it all.
REPACK: the end of the VACUUM FULL era
An old problem, familiar to anyone who has run a large OLTP database: UPDATE and DELETE leave dead rows, VACUUM marks the space reusable, but never shrinks the file. A year of heavy churn later, a table holding 40 GB of data lives in a 200 GB file — bloat. Indexes suffer the same way.
The built-in ways to compact it were two, both bad: VACUUM FULL and CLUSTER take an ACCESS EXCLUSIVE lock — for the duration of the rewrite the table is unavailable to absolutely everyone. On a terabyte table that’s hours. Hence the industry crutch pg_repack: online rewrite via a temporary copy, but an external tool you have to install, upgrade, and clean up replication slots after.
In 19 this is solved in the core: the new REPACK command replaces both VACUUM FULL and CLUSTER (the old ones remain for compatibility — there’s no reason to keep using them):
REPACK TABLE events; -- fast, but ACCESS EXCLUSIVE, like VACUUM FULL
REPACK (CONCURRENTLY) TABLE events; -- online: reads and writes keep going
What matters about CONCURRENTLY:
- The mechanics are a replication slot. Changes made during the rewrite are caught up via logical replication; how many repacks can run at once is capped by
max_repack_replication_slots. - You need spare disk. A second copy of the table and its indexes is built alongside the original — during the operation you need roughly twice the space.
- Slots hold WAL. A crashed and forgotten
REPACK (CONCURRENTLY)with a slot is the samepg_walbloat risk as a forgotten subscription. Slot monitoring is still on you. - Progress is visible in
pg_stat_progress_repack— a new view that also covers legacyCLUSTER/VACUUM FULL.
The practical effect: repacking bloated tables stops being a “Saturday night with sign-off” event and becomes a routine background operation.
Async I/O: from experiment to normal
For honesty: asynchronous I/O didn’t appear in 19 — io_method = worker | io_uring arrived in PostgreSQL 18. There it felt like “enable it and see if you’re lucky”. In 19 the machinery was finished:
- Workers auto-scale. Instead of a fixed
io_workers(that variable is gone entirely) you now getio_min_workersandio_max_workersplus idle timeouts: the I/O worker pool grows under load and shrinks back when it’s gone. - Read-ahead for large reads was reworked — a seq scan is issued in batches of adjacent blocks; the most visible win on a cold cache.
- Streaming reads reached the corners: GIN index vacuum, hash bulk-delete, bloom, and even
pgstattuplenow read through the new stack instead of one page at a time. - I/O became visible.
EXPLAIN (ANALYZE, IO)reports async I/O activity per plan node, andauto_explain.log_ioputs it into the slow-query log.
What to enable: on Linux 5.10+ try io_method = io_uring; worker is the safe fallback. One Kubernetes caveat: container runtime seccomp profiles have historically blocked io_uring syscalls — if the database in a pod refuses to start with io_uring, check the profile first. Measure before and after switching: your heaviest seq scan under EXPLAIN (ANALYZE, BUFFERS, IO) plus pg_stat_io.
Optimizer and autovacuum: quiet but useful
No loud planner headlines in this release, but several changes land in typical queries.
NOT IN becomes an ANTI JOIN. A classic antipattern that used to execute as a nested subplan:
SELECT count(*) FROM orders
WHERE customer_id NOT IN (
SELECT customer_id FROM blocked_customers
WHERE removed_at IS NULL
);
Every NOT IN used to run as a SubPlan — row by row, degrading badly at scale. Now, when NULLs don’t interfere (as here — removed_at IS NULL guarantees no NULLs from the subquery), the planner rewrites it into an anti join executed with a hash. More LEFT JOINs get rewritten into anti joins too, Memoize now works for anti joins with unique inner sides, and some aggregation is pushed below the join — fewer rows enter the JOIN in the first place.
For advanced users — the pg_plan_advice and pg_stash_advice extensions: planner decision control keyed by query id, the answer to the eternal “the plan keeps flip-flopping”.
Autovacuum:
- Parallel index cleanup. Workers split a table’s indexes among themselves (
autovacuum_max_parallel_workersglobally,autovacuum_parallel_workersas a per-table storage parameter). For a wide table with a dozen indexes that’s multiples. - Priority scoring. Table order in the autovacuum queue is now a weighted score (freeze age, dead tuples, inserts, analyze): the weights are five GUC variables, and the queue is visible in the new
pg_stat_autovacuum_scores. - Regular scans help vacuum. A
SELECTnow marks fully-visible pages in the visibility map — previously onlyVACUUMandCOPY ... FREEZEcould. Part of bloat protection happens in the background, for free. - A separate ANALYZE log knob —
log_autoanalyze_min_duration: long statistics collection no longer hides behind vacuum settings.
PostgreSQL 18 vs 19
| PostgreSQL 18 | PostgreSQL 19 | |
|---|---|---|
| Bloat compaction | VACUUM FULL / CLUSTER with a lock, or external pg_repack | REPACK (CONCURRENTLY) online, built in |
| Async I/O | io_method with fixed io_workers, no observability | auto-scaling workers, better read-ahead, EXPLAIN (ANALYZE, IO) |
| Autovacuum | indexes cleaned sequentially, order by age | parallel workers + priority scoring (pg_stat_autovacuum_scores) |
NOT IN (SELECT …) | SubPlan, degrades at scale | rewritten as an ANTI JOIN |
| Logical replication | needs wal_level = logical + restart | enables at wal_level = replica without restart |
| Sequences in logical replication | moved by hand after cutover | published and synchronized (REFRESH SEQUENCES) |
| JIT | on by default | off by default |
| TOAST compression | pglz | lz4 by default |
What you need to migrate
Breaking changes first
There are few, but check before, not after:
- JIT is off by default. If heavy analytics were winning from JIT, enable it by hand (
jit = on) and re-verify at the rehearsal. max_locks_per_transactionis now 128 (was 64), and lock memory accounting changed: the same capacity now needs a doubled value. If you set it manually, recalculate.- MD5 warns, RADIUS is gone. Time to move old authentication to SCRAM.
standard_conforming_stringsis alwayson. Dumps taken by an oldpg_dumpwith itoffwon’t load into 19 — take dumps with version 19 binaries.pg_upgradewill refuse if the database has btree_gist indexes oninet/cidr(they’re broken) or CR/LF in names of databases, roles, tablespaces. For ICU-locale databases, the release notes also recommend rebuilding full-text search andpg_trgmindexes after the upgrade.
Upgrade path: pg_upgrade —link or logical replication
pg_upgrade --link — minutes even on hundreds of gigabytes: files aren’t copied but hard-linked between the old and new PGDATA. The price: once the new cluster starts, the old one is dead (data is shared), there is no way back without a backup, and downtime equals upgrade time plus application checks. Fits when a 10–30 minute window is acceptable.
Logical replication — near-zero downtime: stand up 19 next to it, subscribe, catch up, switch the application. The historical pains are manual DDL and especially sequences (moved by scripts, then duplicate-key errors on the new cluster). In 19 both pains shrink: sequences are published and synchronized by Postgres itself (ALL SEQUENCES / REFRESH SEQUENCES), and enabling logical replication only needs wal_level = replica — no more restart with logical just to start a migration. DDL is still manual. A bonus for standby setups: the new WAIT command gives read-your-writes after a switchover — the application waits for a specific LSN instead of “it’ll catch up eventually”.
The rehearsal on a clone is mandatory, it’s part of the plan. Clone production (a pgBackRest restore — covered here) and run:
# 1. dry run: surfaces every reason it would fail, in advance
/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 \
--link --check
# 2. the real run, timed — this is your downtime window
time /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 \
--link --jobs 4
After the upgrade — ANALYZE (pg_upgrade has --analyze-in-stages), application smoke tests, and only then the production switch.
A config for 19
A minimal postgresql.conf to start from:
# async I/O: io_uring on kernel 5.10+, otherwise worker
io_method = io_uring
io_max_workers = 8 # auto-scaling ceiling; minimum and timeouts — defaults
# autovacuum: parallel index cleanup
autovacuum_max_parallel_workers = 2
log_autoanalyze_min_duration = 10s # long ANALYZE runs — separate log
# if analytics got slower after the upgrade — bring JIT back
# jit = on
Then watch: pg_stat_io, EXPLAIN (ANALYZE, IO) on heavy queries, pg_stat_autovacuum_scores on hot tables.
In Kubernetes: CloudNativePG
If the database runs under CloudNativePG, since 1.24 the operator handles major upgrades itself: you change the image version in spec.imageName — it spawns a temporary instance, runs pg_upgrade, and rolls the cluster. Check before:
- Free space on the PVC — a second copy of the data is needed during the upgrade.
- Extensions in the new image — everything from
pg_extensionmust exist in the 19 image. - A fresh backup — WAL archive and the latest full backup verified, the rollback path written down.
- The pod’s seccomp profile — if you plan
io_method = io_uringin the cluster, make sure the runtime isn’t cutting the syscalls. - The schedule — the operator restarts instances; this isn’t zero-downtime, plan a short window and verify the application reconnects.
How to verify it works
Three quick checks after the upgrade:
psql -c "SHOW io_method;" # io_uring (or worker, if that's the call)
-- async I/O in action on a heavy seq scan
EXPLAIN (ANALYZE, BUFFERS, IO)
SELECT count(*) FROM events WHERE created_at > now() - interval '7 days';
-- repack progress in real time
SELECT * FROM pg_stat_progress_repack;
-- what autovacuum cleans next
SELECT * FROM pg_stat_autovacuum_scores ORDER BY score DESC LIMIT 10;
The difference from sync in EXPLAIN is obvious on a cold cache. And run REPACK (CONCURRENTLY) on a test bloated table during the rehearsal: you’ll see the phases in pg_stat_progress_repack and the slot in pg_replication_slots that must disappear when it finishes.
Bottom line
Don’t upgrade production on GA day — this is 19.0, and the first minor (19.1) traditionally lands a quarter later: by February 2027 the freshest bugs will be collected. But don’t park it in “someday” either: REPACK (CONCURRENTLY) closes Postgres’ oldest operational pain, async I/O finally has observability, and sequence replication plus restart-free enablement remove the two main arguments against a zero-downtime migration. The plan: now — a rehearsal on a clone and a pass over breaking changes; at 19.1 — production via pg_upgrade --link with a short window or via logical replication without one. It’s a fair trade: a few evenings of preparation in exchange for the end of nightly VACUUM FULL drama.