Postgres is excellent at waiting, and very client: In case the standby node results in being unavailable, then the client connection stays on-maintain for an infinite timeframe (or at least until finally a restart). We made the open source pg_auto_failover to put into practice fault tolerance for Postgres architectures in https://rickeyz975yjt6.wikifiltraciones.com/user