PG_AUTOCTL_SHOW_SETTINGS(1)
β¨ NAME β¨
pg_autoctl show settings β bestie, this is your little window into the replication settings of a formation, straight from the monitor. It's the pg_autoctl show settings command, and it prints out the replication settings for a formation. π
π SYNOPSIS π
So the whole thing is this command, and it lets you review all the replication settings of a given formation (and yeah, it defaults to 'default', as per usual around here):
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 π¦
Okay so first thing, heads up: there's also pg_autoctl get formation settings, which is literally a synonym. Same thing, different name, no cap.
The output contains settings and values that apply at different contexts. 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 contexts get listed, and let me break them down for you:
- The "formation" context contains a single entry β the value of
number_sync_standbysfor the target formation. - The "primary" context contains one entry per group of Postgres nodes in the formation, and it shows the current value of the
synchronous_standby_namesPostgres setting as computed by the monitor. It should match what's currently set on the primary node β unless you catch it mid-change, which you can spot because the primary will be in theAPPLY_SETTINGstate. - The "node" context contains two entries per node: one line shows the replication quorum setting of the node, and another line shows the candidate priority of the node.
Bottom line bestie: this command gives you an overview of all the settings that apply to the current formation. Iconic. π
π 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's possible to show the Postgres URI from the monitor node using the commandpg_autoctl show uri. Defaults to the value of the environment variablePG_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 π
Okay so here's the moment you've been waiting for, the live demo, watch this:
$ 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
Like, look at that. Three nodes, all quorum-true, all priority 50, one sync standby. Slay. β¨
π AUTHOR π
Microsoft
π«Ά COPYRIGHT π«Ά
Copyright (c) Microsoft Corporation. All rights reserved.
and that's a wrap on the pg_autoctl show settings page, bestie!! π this was version 2.1, dated Jan 18, 2025, from the pg_auto_failover era of the manual β go forth and check your replication settings, you've got this, mwah πβ¨π¦
π¦ where this page comes from
- fedora 43: pg_auto_failover 2.1-6.fc42 Β· Apache-1.0
- fedora 44: pg_auto_failover 2.1-6.fc42 Β· Apache-1.0
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms