efm_extension
efm_extension · SQL interface for EDB Failover Manager cluster management
Overview
| ID | Extension | Package | Version | Category | License | Language |
|---|---|---|---|---|---|---|
| 100536 | efm_extension | efm_extension | 1.1 | ADMIN | PostgreSQL | C |
PostgreSQL · 14, 15, 16, 17, 18
Usage
Sources:
efm_extension exposes EDB Failover Manager status and management commands through SQL. It executes the installed EFM command-line program through a restricted sudo boundary, adds structured status, cache, history, and monitoring views, and separates read-only monitoring from superuser-only topology changes.
Configure and Monitor
Install and configure EFM first, create a narrowly scoped sudoers policy for the PostgreSQL operating-system account, and set the cluster, binary, properties, Java, and sudo paths. The optional cache/history worker requires preloading and a restart.
efm_cluster_status(), efm_cluster_status_json(), efm_get_nodes(), efm_list_properties(), and cache/metrics views form the monitoring surface. efm_allow_node(), efm_disallow_node(), efm_set_priority(), efm_failover(), efm_switchover(), and efm_resume_monitoring() remain management operations for superusers.
Failover and Host-Security Boundaries
Management calls change an external HA cluster and are not rolled back when the surrounding PostgreSQL transaction aborts. A failover or switchover may disconnect the very session that invoked it. Require explicit operational authorization, serialize changes, confirm candidate health and lag, and verify the resulting EFM and PostgreSQL topology independently.
The database backend can execute configured host commands as the EFM account. Pin absolute paths, permit only exact EFM subcommands in sudoers, protect GUCs and properties files, and do not grant configuration or function access to untrusted roles. Cached status can be stale by efm.cache_ttl, while background-history persistence adds local writes and retention needs. Match extension 1.1 to the exact EFM CLI/output version and exercise exit-code mapping, timeouts, stderr, worker restart, and loss of EFM connectivity before production use.