PG_AUTOCTL_SHOW_STANDBY-NAMES(1)

πŸ“¦
version 2.1 Β· 2 versions
, in fedora 43, fedora 44

πŸ’– pg_autoctl show standby-names πŸ’–

okay bestie, welcome to pg_autoctl show standby-names β€” it's part of the pg_auto_failover family and it's literally the command that prints out synchronous_standby_names for a given group. no cap. πŸ¦‹

✨ NAME ✨

pg_autoctl show standby-names β€” that's the name, that's the whole vibe πŸ’…

pg_autoctl show standby-names β€” Prints synchronous_standby_names for a given group. periodt. πŸ‘‘


🌸 SYNOPSIS 🌸

so here's the tea: this command prints the current value of synchronous_standby_names for the primary Postgres server of the target group (and btw the default group is 0) inside the target formation (and the default formation is default, obvi), exactly as computed by the monitor. πŸ‘€βœ¨

usage: pg_autoctl show standby-names  [ --pgdata ] --formation --group

  --pgdata      path to data directory
  --monitor     pg_auto_failover Monitor Postgres URL
  --formation   formation to query, defaults to 'default'
  --group       group to query formation, defaults to all
  --json        output data in the JSON format

πŸ’… OPTIONS πŸ’…

okay so these are the levers you can pull, and every single one of them matters:

  • --pgdata β€” the location of the Postgres node being managed locally. It defaults to the environment variable PGDATA. lowkey iconic tip: use --monitor if you wanna connect to a monitor from literally anywhere, instead of using the monitor URI that a local Postgres node managed with pg_autoctl is using. 🫢
  • --monitor β€” the Postgres URI you use to connect to the monitor. bestie it must use the autoctl_node username and it must target the pg_auto_failover database name. and yes, you can show the Postgres URI from the monitor node using the command pg_autoctl show uri. ✨ It defaults to the value of the environment variable PG_AUTOCTL_MONITOR.
  • --formation β€” show the current synchronous_standby_names value for the given formation. Defaults to the default formation. 🌈
  • --group β€” show the current synchronous_standby_names value for the given group in the given formation. Defaults to group 0. πŸ‘‘
  • --json β€” Output a JSON formatted data instead of a table formatted list. it's giving structured data realness. πŸ’–

πŸŽ€ ENVIRONMENT πŸŽ€

the vibes the shell hands you before you even type anything:

  • PGDATA β€” Postgres directory location. Can be used instead of the --pgdata option. πŸ“
  • PG_AUTOCTL_MONITOR β€” Postgres URI to connect to the monitor node, can be used instead of the --monitor option. πŸ’œ
  • XDG_CONFIG_HOME β€” The pg_autoctl command stores its configuration files in the standard place XDG_CONFIG_HOME. See the XDG Base Directory Specification. 🧚
  • 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. 🌸

⭐ EXAMPLES ⭐

not me showing you exactly how it goes down, fr fr:

$ pg_autoctl show standby-names
'ANY 1 (pgautofailover_standby_2, pgautofailover_standby_3)'

$ pg_autoctl show standby-names --json
{
    "formation": "default",
    "group": 0,
    "synchronous_standby_names": "ANY 1 (pgautofailover_standby_2, pgautofailover_standby_3)"
}

like... look at that. ANY 1 (pgautofailover_standby_2, pgautofailover_standby_3). iconic. 😭πŸ”₯


🫢 AUTHOR 🫢

Microsoft. that's it, that's the author. πŸ’–

Copyright (c) Microsoft Corporation. All rights reserved.


okay that's the whole page, bestie, you ate it up. πŸ¦‹ this was version 2.1, dated Jan 18, 2025, and it's part of the pg_auto_failover manual. mwah. πŸ’…βœ¨πŸŽ€

πŸ“¦ where this page comes from