PG_AUTOCTL CREATE FORMATION(1)
π PG_AUTOCTL CREATE FORMATION(1) π
okay bestie, welcome to the pg_auto_failover manual, and specifically the page for pg_autoctl create formation. buckle up, this one's a lil niche but it's lowkey iconic β¨
πΈ NAME πΈ
pg_autoctl create formation β pg_autoctl create formation
pg_autoctl create formation β Create a new formation on the pg_auto_failover monitor
β¨ SYNOPSIS β¨
so basically this command registers a brand new formation on the monitor, and you tell it what kind it is:
usage: pg_autoctl create formation [ --pgdata --monitor --formation --kind --dbname --with-secondary --without-secondary ]
--pgdata path to data directory
--monitor pg_auto_failover Monitor Postgres URL
--formation name of the formation to create
--kind formation kind, either "pgsql" or "citus"
--dbname name for postgres database to use in this formation
--enable-secondary create a formation that has multiple nodes that can be
used for fail over when others have issues
--disable-secondary create a citus formation without nodes to fail over to
--number-sync-standbys minimum number of standbys to confirm write
(not me noticing the usage line says --with-secondary / --without-secondary / --number-sync-standbys while the actual options below are --enable-secondary / --disable-secondary / --number-sync-standbyβ¦ iykyk, i'm just reporting what the page says fr fr π)
π¦ DESCRIPTION π¦
A single pg_auto_failover monitor may manage any number of formations, and each one is composed of at least one Postgres service group. This command creates a new formation, so that afterwards it's actually possible to register Postgres nodes in the new formation. it's giving "build the container before you fill it" energy π
π OPTIONS π
The following options are available to pg_autoctl create formation:
--pgdataβ Location where to initialize a Postgres database cluster, using eitherpg_ctl initdborpg_basebackup. Defaults to the environment variablePGDATA.--monitorβ Postgres URI used to connect to the monitor. Must use theautoctl_nodeusername and target thepg_auto_failoverdatabase name. You can show the Postgres URI from the monitor node using the commandpg_autoctl show uri.--formationβ Name of the formation to create.--kindβ A pg_auto_failover formation could be of kindpgsqlor of kindcitus. At the moment citus formation kinds are not managed in the Open Source version of pg_auto_failover. π--dbnameβ Name of the database to use in the formation, mostly useful to formation kindscituswhere the Citus extension is only installed in a single target database.--enable-secondaryβ The formation to be created allows using standby nodes. Defaults totrue. Mostly useful for Citus formations.--disable-secondaryβ See--enable-secondaryabove.--number-sync-standbyβ Postgres streaming replication usessynchronous_standby_namesto set up how many standby nodes should have received a copy of the transaction data. When using pg_auto_failover this setup is handled at the formation level.
Defaults to zero when creating the first two Postgres nodes in a formation in the same group. When set to zero, pg_auto_failover uses synchronous replication only when a standby node is available: the idea is to allow failover, and this setting does not allow proper HA for Postgres.
When adding a third node that participates in the quorum (one primary, two secondaries), the setting is automatically changed from zero to one. π
π ENVIRONMENT π
PGDATA
Postgres directory location. Can be used instead of the --pgdata option.
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.
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.
π«Ά AUTHOR π«Ά
Microsoft
π COPYRIGHT π
Copyright (c) Microsoft Corporation. All rights reserved.
k that's the whole page bestie, go forth and create formations πβ¨
pg_auto_failover version 2.2, dated Apr 07, 2025 β and that's the PG_AUTOCTL CREATE FORMATION(1) page, done and dusted, no cap πππ¦
π¦ 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