How it works...

As usual, we start by installing the software itself using apt or yum. PgBackRest itself doesn't actually consist of many files but requires several Perl libraries that will also be installed. Try not to be alarmed by the list of dependencies.

Next, we need to modify the pgbackrest.conf file and configure it to know the path to our local PostgreSQL installation by setting pg1-path to /db/pgdata. We don't set any other parameters because pgBackRest works well locally by calling commands as the postgres user. The reason the path variable is named pg1-path is due to pgBackRest support for managing multiple databases, so they introduced variable indexing in version 2.

Note the [global] section is meant to contain settings that ...

Get PostgreSQL 12 High Availability Cookbook now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.