If this parameter contains an
=
sign or starts with a valid
URI
prefix (postgresql://
or
postgres://), it is treated as a
conninfo
string. See
Section 31.1.1, \(lqConnection Strings\(rq, in the documentation
for more information.

-h hostname--host=hostname

Specifies the host name of the machine on which the server is running. If the value begins with a slash, it is used as the directory for the Unix-domain socket.

-p port--port=port

Specifies the TCP port or the local Unix-domain socket file extension on which the server is listening for connections. Defaults to the value of the
PGPORT
environment variable or, if not set, to the port specified at compile time, usually 5432.

-q--quiet

Do not display status message. This is useful when scripting.

-t seconds--timeout=seconds

The maximum number of seconds to wait when attempting connection before returning that the server is not responding. Setting to 0 disables. The default is 3 seconds.

pg_isready
returns
0
to the shell if the server is accepting connections normally,
1
if the server is rejecting connections (for example during startup),
2
if there was no response to the connection attempt, and
3
if no attempt was made (for example due to invalid parameters).

It is not necessary to supply correct user name, password, or database name values to obtain the server status; however, if incorrect values are provided, the server will log a failed connection attempt.