Installation Instructions for pglogical
pglogical is available as RPMs via yum for CentOS, & RHEL, and as DEBs via apt for Debian and Ubuntu. Please see below for instructions on installing from source.
YUM Repository for pglogical
The instructions below are valid for Red Hat family of operating systems (RHEL, CentOS).
Pre-Requisites
These RPMs all require the PGDG PostgreSQL releases from http://yum.postgresql.org/. You cannot use them with stock PostgreSQL releases included in RHEL. If you don’t have PostgreSQL already:
- Install the appropriate PGDG repo rpm from http://yum.postgresql.org/repopackages.php
- Install PostgreSQL
- v9.4: yum install postgresql94-server postgresql94-contrib
- v9.5: yum install postgresql95-server postgresql95-contrib
- v9.6: yum install postgresql96-server postgresql96-contrib
- v10: yum install postgresql10-server postgresql10-contrib
- v11: yum install postgresql11-server postgresql11-contrib
- v12: yum install postgresql12-server postgresql12-contrib
- v13: yum install postgresql13-server postgresql13-contrib
Installing pglogical
You can install the “2ndQuadrant’s General Public” repository for your PostgreSQL version, by running the following instructions as root on the destination Linux server:
curl https://access.2ndquadrant.com/api/repository/dl/default/release/9.4/rpm | bash
curl https://access.2ndquadrant.com/api/repository/dl/default/release/9.5/rpm | bash
curl https://access.2ndquadrant.com/api/repository/dl/default/release/9.6/rpm | bash
curl https://access.2ndquadrant.com/api/repository/dl/default/release/10/rpm | bash
curl https://access.2ndquadrant.com/api/repository/dl/default/release/11/rpm | bash
curl https://access.2ndquadrant.com/api/repository/dl/default/release/12/rpm | bash
curl https://access.2ndquadrant.com/api/repository/dl/default/release/13/rpm | bash
Once the repository is installed, you can proceed to pglogical for your PostgreSQL version:
- PostgreSQL 9.4: yum install postgresql94-pglogical
- PostgreSQL 9.5: yum install postgresql95-pglogical
- PostgreSQL 9.6: yum install postgresql96-pglogical
- PostgreSQL 10: yum install postgresql10-pglogical
- PostgreSQL 11: yum install postgresql11-pglogical
- PostgreSQL 12: yum install postgresql12-pglogical
- PostgreSQL 13: yum install postgresql13-pglogical
Package Signing You may be prompted to accept the repository GPG key for package signing:
Retrieving key from file:///etc/pki/rpm-gpg/RPM-GPG-KEY-2NDQ-DL-DEFAULT Importing GPG key 0xD6BAF0C3: Userid : "Public repository signing key 2ndQuadrant <[email protected]>" Fingerprint: 8565 305c ea7d 0b66 4933 d250 9904 cd4b d6ba f0c3 From : /etc/pki/rpm-gpg/RPM-GPG-KEY-2NDQ-DL-DEFAULT Is this ok [y/N]:
If so, accept the key (if it matches the above) by pressing ‘y’ then enter. (It’s signed by the 2ndQuadrant master packaging key, if you want to verify that.)
APT Repository for pglogical
The instructions below are valid for Debian and all Linux flavors based on Debian (e.g. Ubuntu).
Pre-Requisites
You can install the “2ndQuadrant’s General Public” repository by running the following instructions as root on the destination Linux server:
curl https://access.2ndquadrant.com/api/repository/dl/default/release/deb | bash
- Add the http://apt.postgresql.org/ repository. See the site for instructions.
Installing pglogical
Once pre-requisites are complete, installing pglogical is simply a matter of executing the following for your version of PostgreSQL:
- PostgreSQL 9.4: sudo apt-get install postgresql-9.4-pglogical
- PostgreSQL 9.5: sudo apt-get install postgresql-9.5-pglogical
- PostgreSQL 9.6: sudo apt-get install postgresql-9.6-pglogical
- PostgreSQL 10: sudo apt-get install postgresql-10-pglogical
- PostgreSQL 11: sudo apt-get install postgresql-11-pglogical
- PostgreSQL 12: sudo apt-get install postgresql-12-pglogical
- PostgreSQL 13: sudo apt-get install postgresql-13-pglogical
Installing pglogical from Source Code
Source code installs are the same as for any other PostgreSQL extension built using PGXS. Make sure the directory containing pg_config
from the PostgreSQL release is listed in your PATH
environment variable. You might have to install a -dev
or -devel
package for your PostgreSQL release from your package manager if you don’t have pg_config
. Then run make USE_PGXS=1
to compile, and make USE_PGXS=1 install
to install. You might need to use sudo
for the install step. e.g. for a typical RHEL 7 install, assuming you’re using the yum.postgresql.org packages for PostgreSQL:
sudo dnf install postgresql96-devel ; sudo PATH=/usr/pgsql-9.6/bin:$PATH make USE_PGXS=1 clean all ; sudo PATH=/usr/pgsql-9.6/bin:$PATH make USE_PGXS=1 install
Important
Note that you must install pglogical on all servers that will act as publishers or subscribers. So if you’re replicating from 9.4 to 9.5 you’d install postgresql94-pglogical on the 9.4 server and postgresql95-pglogical on the 9.5 server.
For more information, please read the pglogical README.md in /usr/share/doc/postgresql-pglogical/README.md where would be 94,95,96,10,11, 12, 13