PG_AUTOCTL CONFIG GET(1)
β¨ PG_AUTOCTL CONFIG GET(1) β¨
okay bestie, welcome to pg_auto_failover's very own little lookup tool, aka pg_autoctl config get π
πΈ NAME πΈ
pg_autoctl config get β pg_autoctl config get
pg_autoctl config get β literally just go grab the value of a given pg_autoctl configuration variable for you π«Ά
π SYNOPSIS π
This command prints a pg_autoctl configuration setting, no cap:
usage: pg_autoctl config get [ --pgdata ] [ --json ] [ section.option ]
--pgdata path to data directory
β¨ OPTIONS β¨
--pgdataβ where the Postgres node you're managing locally keeps its data directory. It defaults to the environment variablePGDATA. And heads up: if you wanna connect to a monitor from literally anywhere, use--monitorinstead of the monitor URI that a local Postgres node managed withpg_autoctlis using. π--jsonβ output the data all formatted as JSON. π
π¦ ENVIRONMENT π¦
PGDATAβ Postgres directory location. You can use this instead of the--pgdataoption, fr fr.PG_AUTOCTL_MONITORβ Postgres URI to connect to the monitor node; can be used instead of the--monitoroption. πXDG_CONFIG_HOMEβ thepg_autoctlcommand stores its configuration files in the standard placeXDG_CONFIG_HOME. See the XDG Base Directory Specification. πXDG_DATA_HOMEβ thepg_autoctlcommand stores its internal states files in the standard placeXDG_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, that's how it's spelled in the source, iconic π). The configuration file for pg_autoctl is stored using the INI format.
When no argument is given to pg_autoctl config get, the entire configuration file shows up in the output. And if you're sitting there like "where is this config file even at??" β go look at pg_autoctl show file, specifically pg_autoctl show file --config. iykyk π
π EXAMPLES π
With no arguments, we get the whole entire file:
$ 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
You can also pipe the JSON formatted output straight into the jq command line and filter the result down to one specific section of the file. obsessed:
$ 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"
}
And finally, a single configuration element can be listed, just like that β¨:
$ pg_autoctl config get --pgdata node1 ssl.sslmode --json
require
π AUTHOR π
Microsoft
π COPYRIGHT π
Copyright (c) Microsoft Corporation. All rights reserved.
okay that's the whole page, you ate it π this was pg_auto_failover version 2.2, dated Apr 07, 2025 β periodt, go get your config values bestie ππ¦π
π¦ where this page comes from
- debian trixie: pg-auto-failover-cli 2.2-2 Β· PostgreSQL
- ubuntu questing: pg-auto-failover-cli 2.2-2
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms