Skip to content
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

  • REPACK reclaims space from table bloat and can reorder rows to match an index. REPACK (CONCURRENTLY) does so without blocking reads or writes. VACUUM FULL and CLUSTER remain available for compatibility.
  • pg_plan_advice lets users stabilize plan choices or test alternatives using the plan advice language. pg_stash_advice stores 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 in pg_stat_autovacuum_scores.

Logical replication and standby reads

  • Creating the first logical replication slot automatically raises the effective WAL level to logical, as shown by effective_wal_level. CREATE PUBLICATION can publish sequence values with FOR ALL SEQUENCES or exclude tables from FOR ALL TABLES with EXCEPT.
  • A standby session can use WAIT FOR LSN to 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 SELECT lets RETURNING return 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 between io_min_workers and io_max_workers, which replace io_workers. JIT is off by default, and lz4 is 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.

Read Official Source

Related PostgreSQL Reference