LinuxCommandLibrary

pg_isready

TLDR

Check if server is ready

$ pg_isready
copy
Check specific host
$ pg_isready -h [host] -p [port]
copy
Check with timeout
$ pg_isready -t [seconds]
copy
Quiet mode
$ pg_isready -q
copy

SYNOPSIS

pg_isready [options]

DESCRIPTION

pg_isready checks PostgreSQL server connection readiness. Returns exit code indicating server status. Useful for scripts and health checks before connecting.

PARAMETERS

-h, --host host

Server hostname.
-p, --port port
Server port.
-t, --timeout seconds
Connection timeout.
-q, --quiet
Suppress output.
-d, --dbname name
Database name.

SEE ALSO

psql(1), pg_ctl(1)

Copied to clipboard