{
    "content": [
        {
            "type": "text",
            "text": "# pg_isready (man)\n\n## NAME\n\npgisready - check the connection status of a PostgreSQL server\n\n## SYNOPSIS\n\npgisready [connection-option...] [option...]\n\n## DESCRIPTION\n\npgisready is a utility for checking the connection status of a PostgreSQL database server.\nThe exit status specifies the result of the connection check.\n\n## TLDR\n\n> Check the connection status of a PostgreSQL server.\n\n- Check connection:\n  `pg_isready`\n- Check connection with a specific hostname and port:\n  `pg_isready {{-h|--host}} {{hostname}} {{-p|--port}} {{port}}`\n- Check connection displaying a message only when the connection fails:\n  `pg_isready {{-q|--quiet}}`\n\n*Source: tldr-pages*\n\n## Sections\n\n- **NAME**\n- **SYNOPSIS**\n- **DESCRIPTION**\n- **OPTIONS** (10 subsections)\n- **EXIT STATUS**\n- **ENVIRONMENT**\n- **NOTES**\n- **EXAMPLES**\n\nUse structuredContent.sections for detailed options, examples, and full documentation.\n"
        }
    ],
    "structuredContent": {
        "command": "pg_isready",
        "section": "",
        "mode": "man",
        "summary": "pgisready - check the connection status of a PostgreSQL server",
        "synopsis": "pgisready [connection-option...] [option...]",
        "tldr_summary": "Check the connection status of a PostgreSQL server.",
        "tldr_examples": [
            {
                "description": "Check connection",
                "command": "pg_isready"
            },
            {
                "description": "Check connection with a specific hostname and port",
                "command": "pg_isready {{-h|--host}} {{hostname}} {{-p|--port}} {{port}}"
            },
            {
                "description": "Check connection displaying a message only when the connection fails",
                "command": "pg_isready {{-q|--quiet}}"
            }
        ],
        "tldr_source": "official",
        "flags": [
            {
                "flag": "-d",
                "long": null,
                "arg": null,
                "description": "--dbname=dbname Specifies the name of the database to connect to. The dbname can be a connection string. If so, connection string parameters will override any conflicting command line options."
            },
            {
                "flag": "-h",
                "long": null,
                "arg": null,
                "description": "--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."
            },
            {
                "flag": "-p",
                "long": null,
                "arg": null,
                "description": "--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."
            },
            {
                "flag": "-q",
                "long": null,
                "arg": null,
                "description": ""
            },
            {
                "flag": "",
                "long": "--quiet",
                "arg": null,
                "description": "Do not display status message. This is useful when scripting."
            },
            {
                "flag": "-t",
                "long": null,
                "arg": null,
                "description": "--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."
            },
            {
                "flag": "-U",
                "long": null,
                "arg": null,
                "description": "--username=username Connect to the database as the user username instead of the default."
            },
            {
                "flag": "-V",
                "long": null,
                "arg": null,
                "description": ""
            },
            {
                "flag": "",
                "long": "--version",
                "arg": null,
                "description": "Print the pgisready version and exit. -?"
            },
            {
                "flag": "",
                "long": "--help",
                "arg": null,
                "description": "Show help about pgisready command line arguments, and exit."
            }
        ],
        "examples": [
            "Standard Usage:",
            "$ pgisready",
            "/tmp:5432 - accepting connections",
            "$ echo $?",
            "Running with connection parameters to a PostgreSQL cluster in startup:",
            "$ pgisready -h localhost -p 5433",
            "localhost:5433 - rejecting connections",
            "$ echo $?",
            "Running with connection parameters to a non-responsive PostgreSQL cluster:",
            "$ pgisready -h someremotehost",
            "someremotehost:5432 - no response",
            "$ echo $?",
            "PostgreSQL 14.23                                2026                                   PGISREADY(1)"
        ],
        "see_also": [],
        "section_outline": [
            {
                "name": "NAME",
                "lines": 2,
                "subsections": []
            },
            {
                "name": "SYNOPSIS",
                "lines": 2,
                "subsections": []
            },
            {
                "name": "DESCRIPTION",
                "lines": 3,
                "subsections": []
            },
            {
                "name": "OPTIONS",
                "lines": 1,
                "subsections": [
                    {
                        "name": "-d",
                        "lines": 4,
                        "flag": "-d"
                    },
                    {
                        "name": "-h",
                        "lines": 4,
                        "flag": "-h"
                    },
                    {
                        "name": "-p",
                        "lines": 5,
                        "flag": "-p"
                    },
                    {
                        "name": "-q",
                        "lines": 1,
                        "flag": "-q"
                    },
                    {
                        "name": "--quiet",
                        "lines": 2,
                        "long": "--quiet"
                    },
                    {
                        "name": "-t",
                        "lines": 4,
                        "flag": "-t"
                    },
                    {
                        "name": "-U",
                        "lines": 3,
                        "flag": "-U"
                    },
                    {
                        "name": "-V",
                        "lines": 1,
                        "flag": "-V"
                    },
                    {
                        "name": "--version",
                        "lines": 3,
                        "long": "--version"
                    },
                    {
                        "name": "--help",
                        "lines": 2,
                        "long": "--help"
                    }
                ]
            },
            {
                "name": "EXIT STATUS",
                "lines": 4,
                "subsections": []
            },
            {
                "name": "ENVIRONMENT",
                "lines": 6,
                "subsections": []
            },
            {
                "name": "NOTES",
                "lines": 4,
                "subsections": []
            },
            {
                "name": "EXAMPLES",
                "lines": 26,
                "subsections": []
            }
        ],
        "sections": {
            "NAME": {
                "content": "pgisready - check the connection status of a PostgreSQL server\n",
                "subsections": []
            },
            "SYNOPSIS": {
                "content": "pgisready [connection-option...] [option...]\n",
                "subsections": []
            },
            "DESCRIPTION": {
                "content": "pgisready is a utility for checking the connection status of a PostgreSQL database server.\nThe exit status specifies the result of the connection check.\n",
                "subsections": []
            },
            "OPTIONS": {
                "content": "",
                "subsections": [
                    {
                        "name": "-d",
                        "content": "--dbname=dbname\nSpecifies the name of the database to connect to. The dbname can be a connection string.\nIf so, connection string parameters will override any conflicting command line options.\n",
                        "flag": "-d"
                    },
                    {
                        "name": "-h",
                        "content": "--host=hostname\nSpecifies the host name of the machine on which the server is running. If the value\nbegins with a slash, it is used as the directory for the Unix-domain socket.\n",
                        "flag": "-h"
                    },
                    {
                        "name": "-p",
                        "content": "--port=port\nSpecifies the TCP port or the local Unix-domain socket file extension on which the server\nis listening for connections. Defaults to the value of the PGPORT environment variable\nor, if not set, to the port specified at compile time, usually 5432.\n",
                        "flag": "-p"
                    },
                    {
                        "name": "-q",
                        "content": "",
                        "flag": "-q"
                    },
                    {
                        "name": "--quiet",
                        "content": "Do not display status message. This is useful when scripting.\n",
                        "long": "--quiet"
                    },
                    {
                        "name": "-t",
                        "content": "--timeout=seconds\nThe maximum number of seconds to wait when attempting connection before returning that\nthe server is not responding. Setting to 0 disables. The default is 3 seconds.\n",
                        "flag": "-t"
                    },
                    {
                        "name": "-U",
                        "content": "--username=username\nConnect to the database as the user username instead of the default.\n",
                        "flag": "-U"
                    },
                    {
                        "name": "-V",
                        "content": "",
                        "flag": "-V"
                    },
                    {
                        "name": "--version",
                        "content": "Print the pgisready version and exit.\n\n-?",
                        "long": "--version"
                    },
                    {
                        "name": "--help",
                        "content": "Show help about pgisready command line arguments, and exit.\n",
                        "long": "--help"
                    }
                ]
            },
            "EXIT STATUS": {
                "content": "pgisready returns 0 to the shell if the server is accepting connections normally, 1 if the\nserver is rejecting connections (for example during startup), 2 if there was no response to\nthe connection attempt, and 3 if no attempt was made (for example due to invalid parameters).\n",
                "subsections": []
            },
            "ENVIRONMENT": {
                "content": "pgisready, like most other PostgreSQL utilities, also uses the environment variables\nsupported by libpq (see Section 34.15).\n\nThe environment variable PGCOLOR specifies whether to use color in diagnostic messages.\nPossible values are always, auto and never.\n",
                "subsections": []
            },
            "NOTES": {
                "content": "It is not necessary to supply correct user name, password, or database name values to obtain\nthe server status; however, if incorrect values are provided, the server will log a failed\nconnection attempt.\n",
                "subsections": []
            },
            "EXAMPLES": {
                "content": "Standard Usage:\n\n$ pgisready\n/tmp:5432 - accepting connections\n$ echo $?\n0\n\nRunning with connection parameters to a PostgreSQL cluster in startup:\n\n$ pgisready -h localhost -p 5433\nlocalhost:5433 - rejecting connections\n$ echo $?\n1\n\nRunning with connection parameters to a non-responsive PostgreSQL cluster:\n\n$ pgisready -h someremotehost\nsomeremotehost:5432 - no response\n$ echo $?\n2\n\n\n\n\n\nPostgreSQL 14.23                                2026                                   PGISREADY(1)",
                "subsections": []
            }
        }
    }
}