PostgreSQL 19 new features: what shipped, what got cut, what to check before upgrading
PostgreSQL 19 is out. The seven changes that matter to working engineers (REPACK CONCURRENTLY, faster foreign-key checks, radix sort, JIT off by default, logical replication without a restart, WAIT FOR LSN, pg_plan_advice), why graph queries (SQL/PGQ) were pulled, and a seven-point upgrade checklist from the release notes.
On this page
- Graph queries: in, then out
- Release date and support
- The seven changes, PG 18 vs PG 19
- 1. REPACK and REPACK (CONCURRENTLY)
- 2. Foreign key checks skip a query
- 3. Radix sort (and SIMD in COPY)
- 4. JIT is off by default
- 5. Logical replication without a restart
- 6. WAIT FOR LSN: read your own writes
- 7. pg_plan_advice: not quite hints
- Smaller ones worth knowing
- Before you upgrade: seven checks
- Sources
Forty-seven commits and 15,857 deleted lines. That is the size of the single commit that pulled graph queries (SQL/PGQ) out of PostgreSQL 19 on 7 September 2026, two months before release. If you searched for “PostgreSQL 19 graph queries”: they are not in 19.
What did ship is a release with fewer headline features and more changes to everyday work: how you shrink a bloated table, how fast foreign keys are checked, what JIT does by default, and whether turning on logical replication needs a restart. This post goes through the seven that matter most, PG 18 against PG 19, then the upgrade checklist from the “Migration to Version 19” section of the release notes. Nothing was benchmarked for this post; every number is quoted from the linked commit or document.
Graph queries: in, then out
SQL/PGQ (the property-graph part of the SQL:2023 standard: CREATE PROPERTY GRAPH, GRAPH_TABLE (... MATCH ...)) was committed on 16 March 2026 and was in betas 1 to 3. During the beta, a pgsql-hackers thread titled “PGQ catalog representation and pg_dump support” found design problems in how graphs were stored in the catalog and dumped. The revert lists 47 commits and changes 125 files, 15,857 lines deleted (docs and tests included).
The Beta 4 announcement pulled four more things in the same release: online enabling of data checksums, temporal UPDATE/DELETE ... FOR PORTION OF, ALTER TABLE ... MERGE/SPLIT PARTITIONS, and the pg_get_*_ddl() functions. Its reason, in one line: “first and foremost, PostgreSQL must be reliable.” The features can “potentially be included in a later major release”, which means PostgreSQL 20 at the earliest. On pgsql-general, Daniel Gustafsson put it plainly: “SQL/PGQ was reverted and will not be in PostgreSQL 19.”
Release date and support
The last three major versions shipped in September (16 on 14 Sep 2023, 17 on 26 Sep 2024, 18 on 25 Sep 2025). PostgreSQL 19 was released on 19 November 2026, after RC 1 on 15 October and a second release candidate on 12 November. RC 2 existed so that the 12 November update release, which fixed 52 security vulnerabilities, was in 19 from day one (more on that release in our 18.7 post).
The versioning policy gives each major version 5 years of fixes, so 19 is supported into late 2031. PostgreSQL 14 reached end of life with 14.25 on 12 November 2026.
The seven changes, PG 18 vs PG 19
| PostgreSQL 18 | PostgreSQL 19 | |
|---|---|---|
| Shrink a bloated table | VACUUM FULL: ACCESS EXCLUSIVE for the whole rewrite |
REPACK (CONCURRENTLY): reads and writes continue, short lock at the end |
| Foreign key check per row | internal SQL query (SPI) | direct probe of the parent’s unique index, ~1.8× faster bulk inserts |
ORDER BY on integer-like keys |
quicksort | radix sort, up to 2× faster (high cardinality, in memory) |
jit default |
on (cost-based) |
off |
| Logical replication | wal_level = logical + restart |
wal_level = replica is enough; turns on when needed |
| Read-your-writes on a standby | poll pg_last_wal_replay_lsn() yourself |
WAIT FOR LSN '...' |
| Plan control | none in core | pg_plan_advice + pg_stash_advice |
1. REPACK and REPACK (CONCURRENTLY)
REPACK replaces VACUUM FULL and CLUSTER under one name (both old commands still work). Without options it behaves like them: an ACCESS EXCLUSIVE lock “acquired at the beginning and remains held throughout”. With CONCURRENTLY, “the bulk of the operation is run with SHARE UPDATE EXCLUSIVE lock, and the ACCESS EXCLUSIVE lock is only acquired during the final phase to swap the table and index files.” Changes made meanwhile are captured with logical decoding and replayed before the swap.
The catches, all from the docs:
- The table needs a primary key or an index-based replica identity; partitioned, unlogged and non-heap tables are out, and it can’t run inside a transaction block.
- You need free disk “at least equal to the sum of the table size and the index sizes”.
- It is not MVCC-safe: “After the repacking transaction commits, the table will appear empty to concurrent transactions, if they are using a snapshot taken before repacking started.” A long report that started before the repack can read zero rows.
- “If more than about 104 million rows are concurrently updated or deleted during the execution of REPACK, the command fails.”
Progress shows in the new pg_stat_progress_repack view. Why tables bloat in the first place is in Why your Postgres table is bigger than its data.
2. Foreign key checks skip a query
Every row inserted into a child table checks that its parent exists. PostgreSQL 18 runs an internal SQL query for that; the 19 fast path “bypasses SPI by directly probing the unique index on the referenced table.” The commit’s benchmark: “~1.8x speedup for bulk FK inserts (int PK/int FK, 1M rows, where PK table and index are cached).” It doesn’t apply when the parent is partitioned or the key is temporal, and ON DELETE CASCADE and friends still take the old path.
3. Radix sort (and SIMD in COPY)
ORDER BY on keys that compare like integers now uses an in-place radix sort. The commit reports queries “up to 2x faster on high cardinality inputs” on pre-warmed buffers, “more modest” gains at moderate cardinality and about the same at very low cardinality. Separately, COPY FROM in text and CSV format now uses SIMD to skip over chunks without special characters instead of scanning byte by byte (no number in the commit).
4. JIT is off by default
The commit explains it well: compiling “may be so expensive, it completely outweighs the JIT benefits for shorter queries”, and “a couple additional INSERTs into a table increase the cost just enough to enable JIT, resulting in a performance cliff.” It adds that “most large-scale deployments already disable JIT by default. Notably, this includes all hyperscalers.” If you run large analytical queries, the release notes say to enable it yourself: test with SET jit = on and keep it where it wins. (For analytics at scale, a columnar engine changes the picture more than JIT does: ClickHouse vs PostgreSQL.)
5. Logical replication without a restart
wal_level can only change at server start. In 19, “when server variable wal_level is replica”, logical replication is enabled automatically when needed; the new effective_wal_level shows what’s active. Sequences replicate too (CREATE PUBLICATION ... FOR ALL SEQUENCES, ALTER SUBSCRIPTION ... REFRESH SEQUENCES), so a switchover to a subscriber no longer starts from stale sequence values. Publications can also EXCEPT tables.
6. WAIT FOR LSN: read your own writes
Write on the primary, read from a lagging standby, and your new row isn’t there. WAIT FOR LSN blocks until the standby has replayed (or written, or flushed) a given LSN, with an optional TIMEOUT and a NO_THROW mode that returns success, timeout or not in recovery instead of raising an error.
7. pg_plan_advice: not quite hints
The PostgreSQL wiki still says: “We are not interested in implementing hints in the exact ways they are commonly implemented on other databases.” pg_plan_advice is the project’s answer: EXPLAIN (PLAN_ADVICE) prints an advice string for the chosen plan (JOIN_ORDER(f d) HASH_JOIN(d) SEQ_SCAN(f d)), and SET pg_plan_advice.advice = '...' pins it. It “works by telling the core planner what should not be done”, so it constrains the planner rather than replacing it. pg_stash_advice applies advice per query ID automatically.
Smaller ones worth knowing
INSERT ... ON CONFLICT DO SELECT ... RETURNINGreturns the existing row (optionallyFOR UPDATE).COPY ... TO (FORMAT json), andCOPY TOstraight from partitioned tables.default_toast_compressionis nowlz4(when built with LZ4).log_lock_waitsis on by default;NOTIFYonly wakes backends listening on that channel.- Parallel autovacuum for indexes (
autovacuum_max_parallel_workers) and an autovacuum scoring system. - New views:
pg_stat_lock,pg_stat_recovery,pg_stat_autovacuum_scores,pg_stat_progress_repack. - Wraparound warnings now start at 100 million transactions left (was 40 million).
Before you upgrade: seven checks
A major upgrade still means pg_upgrade, dump and restore, or logical replication. Rehearse on a copy first. From “Migration to Version 19”:
- Extensions. Every extension needs a build for 19 (pg_upgrade wants the old cluster’s shared objects installed in the new one). Index access method handlers and some planner hooks changed, so C extensions in those areas may need new releases.
- Full text search and pg_trgm now use the database’s locale provider. On ICU or builtin locales, reindex those indexes after
pg_upgradeand recompute storedtsvectorvalues. Indexes usingfuzzystrmatchfunctions: reindex too. - btree_gist on inet/cidr. The default opclass is now GiST’s own, and
pg_upgraderefuses clusters withbtree_gistinet/cidr indexes: drop them first, recreate on 19. - standard_conforming_strings is always on. Dumps made by an older
pg_dumpwith it off won’t load; dump with the 19 tools. - max_locks_per_transaction default went from 64 to 128 and lock allocation changed: “settings must now be doubled to match their capacity in previous releases.”
- io_workers is gone. The I/O worker pool now sizes itself (
io_min_workers2,io_max_workers8): remove the old setting. - Auth. RADIUS is removed; successful MD5 password logins now produce a warning (
md5_password_warnings). Also: names with carriage returns or line feeds blockpg_upgrade, and monitoring queries may need updates for renamed columns and wait events.
Sources
- PostgreSQL 19 release notes, REPACK, WAIT, pg_plan_advice, pg_upgrade
- Announcements: PostgreSQL 19 released (19 Nov 2026), Beta 4, RC 1, RC 2 and 18.7, versioning policy
- Commits: SQL/PGQ and its revert, FK fast path, radix sort, COPY SIMD, JIT off, I/O worker pool
Which feature makes you upgrade first, and which version are you on today? The video version of this post goes through the same seven changes side by side.