Skip to content

Before You Begin

For every platform in this book, you will need:

  • Admin access to the target PostgreSQL database.
  • The psql client installed on the machine you will run the setup commands from.
  • The pg_relay SQL deployment files — obtained by cloning the repository:
git clone https://gitlab.com/pebble-it/pg_relay.git
cd pg_relay
# The SQL files are at: sql/pg_relay--1.0.sql, sql/pg_relay--1.0--1.1.sql, and sql/pg_relay--1.1--1.2.sql

Alternatively, download and extract the release archive from the GitLab releases page:

curl -LO https://gitlab.com/pebble-it/pg_relay/-/releases/latest/downloads/pg_relay--1.2.sql.tar.gz
tar -xzf pg_relay--1.2.sql.tar.gz
# The SQL files are at: sql/pg_relay--1.0.sql, sql/pg_relay--1.0--1.1.sql, and sql/pg_relay--1.1--1.2.sql

A fresh deployment runs all three SQL files, in order — the base script, then each upgrade delta in sequence — arriving at exactly the current version. This is exactly what CREATE EXTENSION does internally on a self-managed server; it just is not available to you directly on a managed cloud service. If you already have an older deployment in place, you only need to run whichever delta(s) bring it forward from its current version (see Upgrading).


Continue to the setup instructions for your own provider: Amazon RDS, Amazon Aurora, Azure, Google Cloud SQL, or another provider.