Skip to content
Reorganize tables in PostgreSQL databases with minimal locks
C PLpgSQL Makefile Shell
Branch: master
Clone or download
df7cb and MasahikoSawada Don't suppress CREATE UNIQUE INDEX output
Latest PostgreSQL minors (11.2 and friends) inhibit setting
client_min_messages greater than 'error'. The output from CREATE UNIQUE
INDEX has previously been ignored because it differs across versions,
but at least 9.4+ behave the same, so just proceed normally.


Close #202
Latest commit d028e98 Feb 15, 2019


pg_repack -- Reorganize tables in PostgreSQL databases with minimal locks

Linux and OSX build status

pg_repack is a PostgreSQL extension which lets you remove bloat from tables and indexes, and optionally restore the physical order of clustered indexes. Unlike CLUSTER and VACUUM FULL it works online, without holding an exclusive lock on the processed tables during processing. pg_repack is efficient to boot, with performance comparable to using CLUSTER directly.

Please check the documentation (in the doc directory or online) for installation and usage instructions.

What about pg_reorg?

pg_repack is a fork of the pg_reorg project, which has proven hugely successful. Unfortunately new feature development on pg_reorg has slowed or stopped since late 2011.

pg_repack was initially released as a drop-in replacement for pg_reorg, addressing some of the shortcomings of the last pg_reorg version (such as support for PostgreSQL 9.2 and EXTENSION packaging) and known bugs.

pg_repack 1.2 introduces further new features (parallel index builds, ability to rebuild only indexes) and bugfixes. In some cases its behaviour may be different from the 1.1.x release so it shouldn't be considered a drop-in replacement: you are advised to check the documentation before upgrading from previous versions.

You can’t perform that action at this time.