PG_AUTOCTL_CONFIG_GET(1)

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

πŸ’… PG_AUTOCTL CONFIG GET β€” the pg_auto_failover girlies' guide ✨

okay so bestie, this is the manual page for pg_autoctl config get, straight out of the pg_auto_failover family (version 2.1, no cap). Buckle up, we're getting your config values and we're gonna look cute doing it. πŸŽ€


✨ NAME ✨

pg_autoctl config get β€” literally just pg_autoctl config get

pg_autoctl config get β€” bestie, it gets the value of a given pg_autoctl configuration variable. That's the whole vibe. 🌸


🌈 SYNOPSIS 🌈

This command prints a pg_autoctl configuration setting, and here's the glow-up:

usage: pg_autoctl config get  [ --pgdata ] [ --json ] [ section.option ]

--pgdata      path to data directory

πŸ’– OPTIONS πŸ’–

  • --pgdata β€” where your Postgres node lives locally, aka the location of the Postgres node being managed locally. It defaults to the environment variable PGDATA. Pro tip moment: use --monitor to connect to a monitor from anywhere, instead of the monitor URI that a local Postgres node managed with pg_autoctl is using. iykyk πŸ’…
  • --json β€” outputs JSON formatted data. slay. ✨

πŸ¦‹ ENVIRONMENT πŸ¦‹

  • PGDATA β€” Postgres directory location. You can use this instead of the --pgdata option. lowkey convenient fr fr.
  • 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. very organized of it honestly.
  • 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. πŸ’œ

🌸 DESCRIPTION 🌸

So when you pass the argument section.option, that's the name of a configuration ooption (yes bestie, the original really spells it like that, iconic typo, we keep it πŸ’€). The configuration file for pg_autoctl is stored using the INI format.

And when no argument is given to pg_autoctl config get, the entire configuration file is given in the output. the way that… it just dumps everything. 😭 To figure out where the configuration file is stored, see pg_autoctl show file and use pg_autoctl show file --config. πŸ“


πŸ”₯ EXAMPLES πŸ”₯

Without arguments, we get the entire file. main character energy:

$ pg_autoctl config get --pgdata node1
[pg_autoctl]
role = keeper
monitor = postgres://autoctl_node@localhost:5500/pg_auto_failover?sslmode=prefer
formation = default
group = 0
name = node1
hostname = localhost
nodekind = standalone

[postgresql]
pgdata = /Users/dim/dev/MS/pg_auto_failover/tmux/node1
pg_ctl = /Applications/Postgres.app/Contents/Versions/12/bin/pg_ctl
dbname = demo
host = /tmp
port = 5501
proxyport = 0
listen_addresses = *
auth_method = trust
hba_level = app

[ssl]
active = 1
sslmode = require
cert_file = /Users/dim/dev/MS/pg_auto_failover/tmux/node1/server.crt
key_file = /Users/dim/dev/MS/pg_auto_failover/tmux/node1/server.key

[replication]
maximum_backup_rate = 100M
backup_directory = /Users/dim/dev/MS/pg_auto_failover/tmux/backup/node_1

[timeout]
network_partition_timeout = 20
prepare_promotion_catchup = 30
prepare_promotion_walreceiver = 5
postgresql_restart_failure_timeout = 20
postgresql_restart_failure_max_retries = 3

It is possible to pipe JSON formatted output to the jq command line and filter the result down to a specific section of the file. obsessed with this combo actually:

$ pg_autoctl config get --pgdata node1 --json | jq .pg_autoctl
{
  "role": "keeper",
  "monitor": "postgres://autoctl_node@localhost:5500/pg_auto_failover?sslmode=prefer",
  "formation": "default",
  "group": 0,
  "name": "node1",
  "hostname": "localhost",
  "nodekind": "standalone"
}

Finally, a single configuration element can be listed. tiny little snack of an output:

$ pg_autoctl config get --pgdata node1 ssl.sslmode --json
require

πŸ‘‘ AUTHOR πŸ‘‘

Microsoft


Copyright (c) Microsoft Corporation. All rights reserved.


and that's the whole page bestie!! πŸ’– this was PG_AUTOCTL CONFIG GET(1) from pg_auto_failover, version 2.1, dated Jan 18, 2025 β€” go forth and read your config, you absolute icon πŸ¦‹βœ¨πŸ’…

πŸ“¦ where this page comes from