PG_AUTOCTL SHOW SETTINGS(1)
β¨ pg_autoctl show settings β¨
okay bestie, welcome to the pg_autoctl show settings page from the pg_auto_failover manual, section 1 π this one's a lil peek behind the curtain at your replication settings, and honestly? it's giving main character energy for your monitor. let's get into it π«Ά
πΈ NAME πΈ
pg_autoctl show settings β pg_autoctl show settings
pg_autoctl show settings β Print replication settings for a formation from the monitor π
π SYNOPSIS π
so this command lets you review all the replication settings of a given formation (and yeah, it defaults to 'default' like always, no surprises there):
usage: pg_autoctl show settings [ --pgdata ] [ --json ] [ --formation ]
--pgdata path to data directory
--monitor pg_auto_failover Monitor Postgres URL
--json output data in the JSON format
--formation pg_auto_failover formation
π¦ DESCRIPTION π¦
also see pg_autoctl get formation settings, which is literally a synonym, same vibes, different name, iykyk β¨
the output contains setting and values that apply at different contexts, and here's what that looks like with a formation of four nodes, where node_4 is not participating in the replication quorum and also not a candidate for failover:
$ pg_autoctl show settings
Context | Name | Setting | Value
----------+---------+---------------------------+-------------------------------------------------------------
formation | default | number_sync_standbys | 1
primary | node_1 | synchronous_standby_names | 'ANY 1 (pgautofailover_standby_3, pgautofailover_standby_2)'
node | node_1 | replication quorum | true
node | node_2 | replication quorum | true
node | node_3 | replication quorum | true
node | node_4 | replication quorum | false
node | node_1 | candidate priority | 50
node | node_2 | candidate priority | 50
node | node_3 | candidate priority | 50
node | node_4 | candidate priority | 0
three replication settings context are listed, and yes there are exactly three, no more no less:
- the
"formation"context contains a single entry β the value ofnumber_sync_standbysfor the target formation π - the
"primary"context contains one entry per group of Postgres nodes in the formation, and shows the current value of thesynchronous_standby_namesPostgres setting as computed by the monitor. it should match what's currently set on the primary node β unless while applying a change, as shown by the primary being in theAPPLY_SETTINGstate π - the
"node"context contains two entry per nodes: one line shows the replication quorum setting of nodes, and another line shows the candidate priority of nodes π
so yeah, this command gives an overview of all the settings that apply to the current formation. obsessed.
π OPTIONS π
--pgdataβ location of the Postgres node being managed locally. defaults to the environment variablePGDATA. use--monitorto connect to a monitor from anywhere, rather than the monitor URI used by a local Postgres node managed withpg_autoctlπ--monitorβ Postgres URI used to connect to the monitor. must use theautoctl_nodeusername and target thepg_auto_failoverdatabase name. it is possible to show the Postgres URI from the monitor node using the commandpg_autoctl show uriπ
defaults to the value of the environment variable PG_AUTOCTL_MONITOR.
--formationβ show the current replication settings for the given formation. defaults to the default formation β¨--jsonβ output a JSON formatted data instead of a table formatted list π§
π ENVIRONMENT π
PGDATAβ Postgres directory location. can be used instead of the--pgdataoption π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 π
β EXAMPLES β
$ pg_autoctl show settings
Context | Name | Setting | Value
----------+---------+---------------------------+-------------------------------------------------------------
formation | default | number_sync_standbys | 1
primary | node1 | synchronous_standby_names | 'ANY 1 (pgautofailover_standby_2, pgautofailover_standby_3)'
node | node1 | candidate priority | 50
node | node2 | candidate priority | 50
node | node3 | candidate priority | 50
node | node1 | replication quorum | true
node | node2 | replication quorum | true
node | node3 | replication quorum | true
π AUTHOR π
Microsoft
π COPYRIGHT π
Copyright (c) Microsoft Corporation. All rights reserved.
and that's a wrap bestie π this was version 2.2, dated Apr 07, 2025, brought to you by the pg_auto_failover girlies β go check your settings, they're probably slaying π
β¨
π¦ 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