Check whether PostgreSQL accepts connections
Build a paste-ready command, then review its compatibility and effects before running it.
pg_isready -h <host> -p 5432 -d <database>Complete required fields to copy the generated command.
Compatibility
LinuxVerified for Linux using posix, bash, zsh syntax.
Operational knowledgereview due 2027-01-20
Requirementspg_isreadypg_isready must be installed and available on PATH.Network accessThe target must be reachable from the current environment.
Version supportpg_isready Current supported releasesVerified for linux using posix, bash, zsh syntax; consult compatibility notes for platform-specific differences.
Expected signalsexample.com:5432 - accepting connectionsRepresentative successful output; values vary with the selected target and system state.
Known errorspg_isready: command not foundpg_isready is missing or is not available on PATH.
Verifypg_isready -h {{host}} -p 5432 -d {{database}}The output matches the expected target and exits without an error.Rollback noteNot required: this command is read-only and does not change system state.
Command breakdown
01pg_isreadyCommandRuns the pg_isready stage of this one-liner.
02-hOptionRequests human-readable units or command help, depending on the tool.
03<host>ParameterA value supplied in the Fill parameters section.
04-pOptionSelects the command-specific port, process, or print mode.
055432ArgumentPasses 5432 to pg_isready.
06-dOptionConfigures pg_isready with the -d option.
07<database>ParameterA value supplied in the Fill parameters section.
Example input
pg_isready -h example.com -p 5432 -d appdb
Example output
example.com:5432 - accepting connections
Illustrative output — exact values vary by system and data.
Official sources