Brendan Buckingham

A blog to share the things I learn to hopefully help others on their programming journeys


Installing pg_repack on EC2 instance with Ubuntu

UPDATED: 10/08/2020

We use pg_repack on our Postgresql database to clean it up periodically. When I started, I hadn’t used it before and found very little information on the web about it, and how to install it. First, I tried installing it locally, which wasn’t too difficult, and I may create a post for that sometime as well. But I decided that it would be better to run it from an EC2 instance instead of my local machine, to avoid possible issues with losing connectivity while running the process. This was less straight forward and required significant digging to get to work. Below are the steps I took:

  • Download the version of pg_repack you want to install using wget

wget 'https://api.pgxn.org/dist/pg_repack/1.4.3/pg_repack-1.4.3.zip'

  • Unzip the package and change to the newly created directory:

sudo unzip pg_repack-1.4.3.zip
cd pg_repack-1.4.3

  • Next, you will need to...

Continue reading →