pg_repack is a PostgreSQL extension that allows you to efficiently reorganize a table to get rid of any excess that it has accumulated. Note that reorganizing a table may take some time, but
pg_repack tries to minimize the locks required so that online operations continue.
To use the
Run the following command as
CREATE EXTENSION pg_repack;
Run the command-line tool that comes with the extension on your own machine.
The command to reorganize a single table looks like the following:
pg_repack -d connstr --no-superuser-check -t tablename
This reorganizes the
Learn how Aiven simplifies PostgreSQL: