Post

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

Snowflake explains PostgreSQL 19’s built-in REPACK command, including a concurrent mode that rewrites a table while capturing changes through logical decoding and takes an exclusive lock for the final swap.

The article notes substantial caveats: space for two copies, an indexable primary key, and restrictions including partitioned tables. It also warns that old snapshots can see an empty table during the rewrite. The concurrent mode trades runtime for availability; it does not replace routine vacuuming.