PostgreSQL failover: Who is responsible for handling it? How do clients connect to the new leader?
https://www.postgresql.org/docs/12/warm-standby-failover.html says:


  PostgreSQL does not provide the system software required to identify a
  failure on the primary and notify the standby database server. Many
  such tools exist and are well integrated with the operating system
  facilities required for successful failover, such as IP address
  migration.



Yes you have to setup something. 


PostgreSQL does not provide automatic procedure for clients.