Skip to content
Planet PostgreSQL·· 13d ago

PostgreSQL 19 vs 18: Native REPACK and Production Upgrade Guide

Aleksei Aleinikov: PostgreSQL 19 vs 18: Native REPACK, pg_plan_advice, Graph Myth & Production Upgrade Guide

Brief · Based on the source excerpt

The article compares PostgreSQL 19 and 18 across operations, SQL, and defaults, highlighting native REPACK (CONCURRENTLY), pg_plan_advice, `INSERT .

Why It Matters

The guide examines PostgreSQL 18-to-19 operational trade-offs, focusing on native REPACK, autovacuum changes, and configuration checks required before production upgrades.

Technical Breakdown · Distilled from the original source

Online maintenance and workload fit

  • In PostgreSQL 18, compacting a bloated table meant choosing between VACUUM FULL, which blocks all reads and writes, and the external pg_repack extension. PostgreSQL 19 brings REPACK into core. For tables that need to keep serving reads and writes during compaction, the article points to REPACK (CONCURRENTLY).
  • The article pairs concurrent repacking with parallel index autovacuum as reasons to upgrade high-churn OLTP clusters with table or index bloat. It separately highlights INSERT ... ON CONFLICT DO SELECT for write-heavy APIs.

Async I/O: fixed workers versus autoscaling

  • PostgreSQL 18 uses the fixed io_workers setting. PostgreSQL 19 replaces it with io_min_workers and io_max_workers, which bound worker autoscaling for bursty storage workloads. It also adds EXPLAIN (ANALYZE, IO) for inspecting I/O during query execution.

Pre-upgrade configuration and feature checks

  • Do not copy the PostgreSQL 18 postgresql.conf unchanged: io_workers was removed, and leaving it in the configuration causes a FATAL startup error. PostgreSQL 19 also defaults jit to off, so account for that change when comparing query performance across versions.
  • The article presents pg_plan_advice in the context of critical join plans changing after a major upgrade. SQL/PGQ graph queries did not make the final PostgreSQL 19 release and should not factor into the upgrade case.
Source: Planet PostgreSQL· postgr.es

PG Radar summarizes verified changes and impact. Read the original post for full technical details and code samples.

Read Official Source

Related PostgreSQL Reference