PostgreSQL pg_repack option in Tower installation

Solution In Progress - Updated -

Environment

  • rhel8/postgresql-12 and higher

Issue

Needing to remove bloat from tables in the default installation of PostgreSQL in Tower without full vacuum.

Resolution

In rhel8/postgresql-12 and higher , the pg_repack is included by default and can be run by those using the container image.

Running the following will add necessary items to the db, run pg_repack to test, and check that the command resulted in a 0 output.

# psql -c "CREATE DATABASE testrepack;"
# psql -c "CREATE EXTENSION pg_repack" testrepack
# pgbench -i -s 50 testrepack
# pg_repack --no-order --table pgbench_accounts testrepack -e
# echo $?
# 0

Root Cause

Container image rhel8/postgresql-11 and lower do not include the pg_repack option.

Diagnostic Steps

Running pg_repack within the container image results in a successful completion of the command.

This solution is part of Red Hat’s fast-track publication program, providing a huge library of solutions that Red Hat engineers have created while supporting our customers. To give you the knowledge you need the instant it becomes available, these articles may be presented in a raw and unedited form.

Comments