Postgres 19's REPACK lets you shrink bloated tables without taking them offline

Postgres 19 Repack: Faster, Built-In Table Bloat Cleanup

Postgres 19's REPACK lets you shrink bloated tables without taking them offline

Postgres 19 adds REPACK as a built-in SQL command, and its CONCURRENTLY mode reclaims bloated table space while the table stays fully readable and writable, taking only a brief lock at the end. It uses WAL-based logical decoding, the same approach as pg_squeeze, so no triggers or external binaries are needed. In one test, a 493 MB table shrank to 228 MB in 9.4 seconds, roughly 1.5 to 2 times slower than VACUUM FULL but without the downtime.

REPACK CONCURRENTLY is slower in wall-clock time. It's doing more work: logical decoding and WAL replay on top of the table rebuild. The tradeoff here is more time to keep your table online.

More from this day

2026-11-20