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.

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
FK bulk insertsPG 18FK bulk inserts, PG 18: 1×1×PG 19FK bulk inserts, PG 19: ~1.8×~1.8×ORDER BY, high card.PG 18ORDER BY, high card., PG 18: 1×1×PG 19 (best case)ORDER BY, high card., PG 19 (best case): up to 2×up to 2×
Speed-ups as reported in the commit messages, not measured here: commit 2da86c1ef (foreign key fast path: "~1.8x speedup for bulk FK inserts", int keys, 1 million rows, parent table and index cached) and commit ef3c3cf6d (radix sort: "up to 2x faster on high cardinality inputs" on pre-warmed buffers; low cardinality about the same). Bars to scale.

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.

startswap + commitVACUUM FULL / REPACKACCESS EXCLUSIVE for the whole rewrite: no reads, no writesREPACK (CONCURRENTLY)SHARE UPDATE EXCLUSIVE: reads + writes go onshort ACCESS EXCLUSIVE to swap files
Schematic, not to scale in time. From the PostgreSQL 19 REPACK docs (Notes on Concurrent Operation). CONCURRENTLY needs a primary key or replica identity, is not MVCC-safe for snapshots older than the repack, and fails if more than about 104 million rows change during the run.

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 ... RETURNING returns the existing row (optionally FOR UPDATE).
  • COPY ... TO (FORMAT json), and COPY TO straight from partitioned tables.
  • default_toast_compression is now lz4 (when built with LZ4).
  • log_lock_waits is on by default; NOTIFY only 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”:

  1. 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.
  2. Full text search and pg_trgm now use the database’s locale provider. On ICU or builtin locales, reindex those indexes after pg_upgrade and recompute stored tsvector values. Indexes using fuzzystrmatch functions: reindex too.
  3. btree_gist on inet/cidr. The default opclass is now GiST’s own, and pg_upgrade refuses clusters with btree_gist inet/cidr indexes: drop them first, recreate on 19.
  4. standard_conforming_strings is always on. Dumps made by an older pg_dump with it off won’t load; dump with the 19 tools.
  5. 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.”
  6. io_workers is gone. The I/O worker pool now sizes itself (io_min_workers 2, io_max_workers 8): remove the old setting.
  7. Auth. RADIUS is removed; successful MD5 password logins now produce a warning (md5_password_warnings). Also: names with carriage returns or line feeds block pg_upgrade, and monitoring queries may need updates for renamed columns and wait events.

Sources

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.