Prerequisites

The postgresql servers must have a replication slot dedicated to each server that will save the WAL files.

Configuration

You must define at least one upstream server like this:

pg_wal_pull_upstream:
  - PG_HOST: "center-db-cluster-1-node-1"
    PG_VERSION: 14
    PG_USERNAME: "pitr-pa7"
    PG_PASSWORD: "{{ global_center_pitr_password }}"
    PG_SLOT: "pitr_pa7"
    PG_PORT: 5432				# optional, default is 5432
    WAL_DIR: "/srv/wal/somewhere"          	# optional local receive directory, default is /srv/wal/PG_HOST
    WAL_RETENTION_IN_DAYS: 14			# optional, default is 14 days

The WAL_RETENTION_IN_DAYS define how much time the WAL will be kept, it must be similar to the retention of the last file system snapshot of the actual PGDATA of the postgresql cluster for the PITR to work for this long.

Optional variables

Variable Description Type of variable Sample value
pg_wal_pull_service_user systemd user string nobody
pg_wal_pull_service_group systemd group string nogroup