Your company here, and a link to your site. Click to find out more.

pg_autoctl_config_get - Man Page


pg_autoctl config get ā€” pg_autoctl config get

pg_autoctl config get ā€” Get the value of a given pg_autoctl configuration variable


This command prints a pg_autoctl configuration setting:

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

--pgdata      path to data directory



Location of the Postgres node being managed locally. Defaults to the environment variable PGDATA. Use --monitor to connect to a monitor from anywhere, rather than the monitor URI used by a local Postgres node managed with pg_autoctl.


Output JSON formatted data.



Postgres directory location. Can be used instead of the --pgdata option.


Postgres URI to connect to the monitor node, can be used instead of the --monitor option.


The pg_autoctl command stores its configuration files in the standard place XDG_CONFIG_HOME. See the XDG Base Directory Specification.


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.


When the argument section.option is used, this is the name of a configuration ooption. 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 is given in the output. To figure out where the configuration file is stored, see pg_autoctl show file and use pg_autoctl show file --config.


Without arguments, we get the entire file:

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

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

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

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

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:

$ 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:

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




Jan 25, 2024 2.1 pg_auto_failover