pg_isready -h 127.0.0.1 -p 5432

Category: Databases & SQL

pg_isready -h 127.0.0.1 -p 5432

Test if PostgreSQL accepts connections

Exits 0 when the server accepts connections and nonzero otherwise, so it fits monitoring scripts and load balancer checks. Use -U to also verify a specific role, or -d to check database reachability.
Looking for more? Search all 7,657 commands — works offline, in English or Spanish, and fixes typos.