Postgresql AutoFailover
Np, PostgreSQL doesn't have any built-in facilities for automatic failover.
You have to use third-party software like Patroni.
Client failover can be managed by using a connection string that looks like
host=host1,host2 port=5432,5432 target_session_attrs=read-write