Movatterモバイル変換


[0]ホーム

URL:



Facebook
Postgres Pro
Facebook
Downloads
pg_isready
Prev UpPostgres Pro Client ApplicationsHome Next

pg_isready

pg_isready — check the connection status of aPostgres Pro server

Synopsis

pg_isready [connection-option...] [option...]

Description#

pg_isready is a utility for checking the connection status of aPostgres Pro database server. The exit status specifies the result of the connection check.

Options#

-ddbname
--dbname=dbname

Specifies the name of the database to connect to. Thedbname can be aconnection string. If so, connection string parameters will override any conflicting command line options.

-hhostname
--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.

-pport
--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 thePGPORT 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.

-tseconds
--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.

-Uusername
--username=username

Connect to the database as the userusername instead of the default.

-V
--version

Print thepg_isready version and exit.

-?
--help

Show help aboutpg_isready command line arguments, and exit.

Exit Status

pg_isready returns0 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, and3 if no attempt was made (for example due to invalid parameters).

Environment

pg_isready, like most otherPostgres Pro utilities, also uses the environment variables supported bylibpq (seeSection 33.15).

The environment variablePG_COLOR specifies whether to use color in diagnostic messages. Possible values arealways,auto andnever.

Notes#

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.

Examples#

Standard Usage:

$pg_isready/tmp:5432 - accepting connections$echo $?0

Running with connection parameters to aPostgres Pro cluster in startup:

$pg_isready -h localhost -p 5433localhost:5433 - rejecting connections$echo $?1

Running with connection parameters to a non-responsivePostgres Pro cluster:

$pg_isready -h someremotehostsomeremotehost:5432 - no response$echo $?2


Prev Up Next
pg_dumpall Home pg_receivewal
pdfepub
Go to Postgres Pro Standard 16
By continuing to browse this website, you agree to the use of cookies. Go toPrivacy Policy.

[8]ページ先頭

©2009-2025 Movatter.jp