OnCallReady

Commands

pg_isready - check the connection status of a PostgreSQL server

pg_isready [OPTION]...

Options you will use

-d, --dbname=DBNAME
database name.
-q, --quiet
run quietly.
-t, --timeout=SECS
seconds to wait when attempting connection, 0 disables (default: 3).
-h, --host=HOSTNAME
database server host or socket directory.
-p, --port=PORT
database server port.
-U, --username=USERNAME
user name to connect as.

Examples

$ pg_isready

/var/run/postgresql:5432 - accepting connections

$ pg_isready -h db.internal -p 5432 -q; echo $?

for a script or a probe

Taught in

Try pg_isready in a real terminal Free, in your browser - a real Ubuntu terminal to try it in, with missions that check your work.