A journal of applied technology
RU/EN
← All stories
Infrastructure·

PostgreSQL 19 can reclaim table space while applications keep working

REPACK rewrites a table after heavy deletes. Its concurrent mode keeps reads and writes available for most of the operation.

Ethernet cables connected to a network switch
User_Pascal / Unsplash

Where it helps

A large delete can leave a table file almost as large as before. REPACK writes the live rows into a new file and gives unused space back to the operating system. PostgreSQL 19 includes a concurrent mode for tables that applications still need to use.

What to check first

Budget for a second copy of the table and its indexes. The final file swap still needs a brief exclusive lock. Check for long transactions and measure the table together with its indexes before scheduling the work.