A real-world example of how to configure HA for PostgreSQL using repmgr for failure detection and failover, and pgbouncer to isolate the old master.
This example is based in a real case we have in Ecuador that has survived some network outages and other kind of not expected failures