Skip to content

Instantly share code, notes, and snippets.

@johanndt
Last active May 22, 2023 05:55
Show Gist options
  • Save johanndt/d32f5ccd248b415c203c1fcc131f23cc to your computer and use it in GitHub Desktop.
Save johanndt/d32f5ccd248b415c203c1fcc131f23cc to your computer and use it in GitHub Desktop.
run pg_repack on existing running postgresql 9.6
apt-get update
apt-get install postgresql-server-dev-11 unzip
cd /tmp
wget http://api.pgxn.org/dist/pg_repack/1.4.4/pg_repack-1.4.4.zip
unzip pg_repack-1.4.4.zip
cd pg_repack-1.4.4
make
make install
su - postgres
psql -c "CREATE EXTENSION pg_repack" -d db_name
/usr/lib/postgresql/11/bin/pg_repack db_name
psql -c "DROP EXTENSION pg_repack" -d db_name
exit
rm -rf /tmp/pg_repack*
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment