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 externalpg_repackextension. PostgreSQL 19 bringsREPACKinto core. For tables that need to keep serving reads and writes during compaction, the article points toREPACK (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 SELECTfor write-heavy APIs.
Async I/O: fixed workers versus autoscaling
- PostgreSQL 18 uses the fixed
io_workerssetting. PostgreSQL 19 replaces it withio_min_workersandio_max_workers, which bound worker autoscaling for bursty storage workloads. It also addsEXPLAIN (ANALYZE, IO)for inspecting I/O during query execution.
Pre-upgrade configuration and feature checks
- Do not copy the PostgreSQL 18
postgresql.confunchanged:io_workerswas removed, and leaving it in the configuration causes aFATALstartup error. PostgreSQL 19 also defaultsjitto off, so account for that change when comparing query performance across versions. - The article presents
pg_plan_advicein 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.