PostgreSQL 19 adds built-in REPACK for online table reorganization
PostgreSQL 19 introduces the REPACK command, including REPACK CONCURRENTLY, enabling table reorganization with minimal downtime. It also supports index-based reorganization similar to CLUSTER, with an approach comparable to Oracle's DBMS_REDEFINITION.
- REPACK CONCURRENTLY builds a compact copy and syncs changes on the fly
- Requires a primary key or suitable NOT NULL unique index
- DDL on the target table is blocked during REPACK
- Extra disk space is needed for a new copy of table and indexes
Read next
Software