PG_AUTOCTL STATUS(1)

✨ pg_autoctl status β€” the vibe check for your service ✨

okay bestie, so this is a page from the pg_auto_failover manual, and it's all about pg_autoctl status. She's a queen. She tells you what's up. πŸ‘‘


🌸 NAME 🌸

pg_autoctl status β€” yes, that's the whole thing, that's the name, we love a minimal icon

pg_autoctl status β€” Display the current status of the pg_autoctl service πŸ’…


πŸŽ€ SYNOPSIS πŸŽ€

This command outputs the current process status for the pg_autoctl service running for the given --pgdata location. That's it. That's the whole job. And she eats every time. πŸ”₯

usage: pg_autoctl status  [ --pgdata ] [ --json ]

--pgdata      path to data directory
--json        output data in the JSON format

πŸ’– OPTIONS πŸ’–

  • --pgdata β€” the location of the Postgres node being managed locally. If you don't say anything, she defaults to the environment variable PGDATA. she's like "fine, I'll figure it out myself" 😌
  • --json β€” outputs JSON formatted data instead of a table formatted list. for when you want the receipts in machine-readable form, no cap 🧚

πŸ¦‹ ENVIRONMENT πŸ¦‹

  • PGDATA β€” Postgres directory location. Can be used instead of the --pgdata option. lowkey the same thing, just vibes-based πŸ“
  • PG_AUTOCTL_MONITOR β€” Postgres URI to connect to the monitor node. that's the group chat she checks in with πŸ’¬
  • XDG_CONFIG_HOME β€” the pg_autoctl command stores its configuration files in the standard place XDG_CONFIG_HOME. See the XDG Base Directory Specification. very "I have a designated spot for everything" energy ✨
  • XDG_DATA_HOME β€” the pg_autoctl command stores its internal states files in the standard place XDG_DATA_HOME, which defaults to ~/.local/share. See the XDG Base Directory Specification. her inner thoughts live there πŸ’œ

🌈 EXAMPLE 🌈

first up, the classic, no extra toppings:

$ pg_autoctl status --pgdata node1
11:26:30 27248 INFO  pg_autoctl is running with pid 26618
11:26:30 27248 INFO  Postgres is serving PGDATA "/Users/dim/dev/MS/pg_auto_failover/tmux/node1" on port 5501 with pid 26725

and now with the --json serve, because sometimes you want it structured, periodt:

$ pg_autoctl status --pgdata node1 --json
11:26:37 27385 INFO  pg_autoctl is running with pid 26618
11:26:37 27385 INFO  Postgres is serving PGDATA "/Users/dim/dev/MS/pg_auto_failover/tmux/node1" on port 5501 with pid 26725
{
    "postgres": {
        "pgdata": "\/Users\/dim\/dev\/MS\/pg_auto_failover\/tmux\/node1",
        "pg_ctl": "\/Applications\/Postgres.app\/Contents\/Versions\/12\/bin\/pg_ctl",
        "version": "12.3",
        "host": "\/tmp",
        "port": 5501,
        "proxyport": 0,
        "pid": 26725,
        "in_recovery": false,
        "control": {
            "version": 0,
            "catalog_version": 0,
            "system_identifier": "0"
        },
        "postmaster": {
            "status": "ready"
        }
    },
    "pg_autoctl": {
        "pid": 26618,
        "status": "running",
        "pgdata": "\/Users\/dim\/dev\/MS\/pg_auto_failover\/tmux\/node1",
        "version": "1.5.0",
        "semId": 196609,
        "services": [
            {
                "name": "postgres",
                "pid": 26625,
                "status": "running",
                "version": "1.5.0",
                "pgautofailover": "1.5.0.1"
            },
            {
                "name": "node-active",
                "pid": 26626,
                "status": "running",
                "version": "1.5.0",
                "pgautofailover": "1.5.0.1"
            }
        ]
    }
}

like?? the detail?? the range?? we're obsessed πŸ˜­πŸ’–


πŸ‘‘ AUTHOR πŸ‘‘

Microsoft


Copyright (c) Microsoft Corporation. All rights reserved.


and that's the whole page, bestie β€” this was PG_AUTOCTL STATUS(1) from pg_auto_failover, version 2.2, dated Apr 07, 2025. go run pg_autoctl status on your own node and tell me what she says πŸ’…βœ¨πŸŒΈ

πŸ“¦ where this page comes from