PostgreSQL Official News·· 15d agoFeatured
PostgreSQL 19 Released with Concurrent REPACK and Plan Advice
PostgreSQL 19 Released!
Key Takeaway
PG 19 REPACK (CONCURRENTLY) permits concurrent reads and writes for most of the operation. The final table and index file swap still requires ACCESS EXCLUSIVE.
Why It Matters
PostgreSQL 19 brings table-bloat management, plan stability, and logical-replication improvements into core, while upgrades should account for authentication and JIT default changes.
Technical Breakdown · Distilled from the original source
Table maintenance and query plans
REPACKreclaims space from table bloat and can reorder rows to match an index.REPACK (CONCURRENTLY)does so without blocking reads or writes.VACUUM FULLandCLUSTERremain available for compatibility.pg_plan_advicelets users stabilize plan choices or test alternatives using the plan advice language.pg_stash_advicestores and automatically applies advice by query identifier without application changes.- Autovacuum can vacuum indexes in parallel, controlled by
autovacuum_max_parallel_workers. Its new table-priority scores are visible inpg_stat_autovacuum_scores.
Logical replication and standby reads
- Creating the first logical replication slot automatically raises the effective WAL level to
logical, as shown byeffective_wal_level.CREATE PUBLICATIONcan publish sequence values withFOR ALL SEQUENCESor exclude tables fromFOR ALL TABLESwithEXCEPT. - A standby session can use
WAIT FOR LSNto wait for WAL replay to reach a specified log sequence number before querying, so the application can read data it just wrote on the primary.
SQL and runtime changes
INSERT ... ON CONFLICT DO SELECTletsRETURNINGreturn the existing row on conflict, saving a network round trip in get-or-create workflows. Faster foreign key checks made bulk inserts nearly twice as fast in testing.- With the default
io_method = worker, PostgreSQL adjusts the I/O worker count betweenio_min_workersandio_max_workers, which replaceio_workers. JIT is off by default, andlz4is the default TOAST compression method when PostgreSQL is built with LZ4 support.
Source: PostgreSQL Official News· postgresql.org
PG Radar summarizes verified changes and impact. Read the original post for full technical details and code samples.