pgautofailover
Overview
| Package | Version | Category | License | Language |
|---|---|---|---|---|
pgautofailover | 2.2 | ADMIN | PostgreSQL | C |
| ID | Extension | Bin | Lib | Load | Create | Trust | Reloc | Schema |
|---|---|---|---|---|---|---|---|---|
| 5150 | pgautofailover | No | Yes | Yes | Yes | No | No | - |
| Related | btree_gist repmgr pg_failover_slots bgw_replstatus pgpool_adm pglogical pgactive pglogical_ticker |
|---|
Version
| Type | Repo | Version | PG Ver | Package | Deps |
|---|---|---|---|---|---|
| EXT | PGDG | 2.2 | 1817161514 | pgautofailover | btree_gist |
| RPM | PGDG | 2.2 | 1817161514 | pg_auto_failover_$v | - |
| DEB | PGDG | 2.2 | 1817161514 | postgresql-$v-auto-failover | - |
Install
You can install pgautofailover directly. First, make sure the PGDG repository is added and enabled:
Install the extension using pig or apt/yum/dnf:
Preload:
Create Extension:
Usage
pg_auto_failover is an extension and service for automated PostgreSQL failover. It consists of a monitor node (running the pgautofailover extension), and keeper processes on each data node managed by the pg_autoctl CLI.
Architecture
- Monitor: a PostgreSQL instance with the
pgautofailoverextension that implements a state machine for failover decisions - Keeper (
pg_autoctl run): runs on each data node, reports health to the monitor and executes state transitions - Supports 2+ node setups with synchronous replication by default
- Supports Citus HA (since v2.0)
Key CLI Commands
Failover Behavior
The monitor tracks node health. When a secondary becomes unavailable or its lag is too high, it is removed from synchronous_standby_names on the primary. Failover/switchover operations are blocked until the secondary is healthy again, preventing data loss.
Documentation
Full documentation: pg-auto-failover.readthedocs.io
Was this page helpful?
Thanks—your feedback helps us improve this page.
What got in the way? (optional)