← 返回命令列表

Linux command

pg_isready 命令

文本

复制后可按需替换文件名、目录或参数。

常用示例

Check if server is ready

pg_isready

Check specific host

pg_isready -h [host] -p [port]

Check with timeout

pg_isready -t [seconds]

Quiet mode

pg_isready -q

说明

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

参数

-h, --host _host_
Server hostname.
-p, --port _port_
Server port.
-t, --timeout _seconds_
Connection timeout.
-q, --quiet
Suppress output.
-d, --dbname _name_
Database name.

FAQ

What is the pg_isready command used for?

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

How do I run a basic pg_isready example?

Run `pg_isready` in a terminal, then adjust file names, paths, flags, or remote targets for your system.

What does -h, --host _host_ do in pg_isready?

Server hostname.