Check connection with a specific hostname and port

pg_isready

  • Check the connection status of a PostgreSQL server.
    More information: <https://www.postgresql.org/docs/current/app-pg-isready.html>.
  • Trick copyright: tl;dr; <https://github.com/tldr-pages/tldr>

pg_isready --host={{hostname}} --port={{port}}

click the source code to copy install pg_isready on any operating system with command-not-found.com