PG_AUTOCTL SET FORMATION NUMBER-SYNC-STANDBYS(1)

✨ NAME ✨

pg_autoctl set formation number-sync-standbys β€” bestie, this is the pg_autoctl set formation number-sync-standbys command, and it's here to set number_sync_standbys for a formation, straight from the monitor. πŸ’…


🌸 SYNOPSIS 🌸

This command sets a pg_autoctl replication settings for number sync standbys, like:

usage: pg_autoctl set formation number-sync-standbys  [ --pgdata ] [ --json ] [ --formation ] <number_sync_standbys>

--pgdata      path to data directory
--formation   pg_auto_failover formation
--json        output data in the JSON format

okay so that's the shape of it: you've got your flags in brackets, and then the actual <number_sync_standbys> value sitting there at the end, being the whole point. πŸŽ€


πŸ¦‹ DESCRIPTION πŸ¦‹

So here's the vibe. The pg_auto_failover monitor makes sure that at least N+1 candidate standby nodes are registered when number-sync-standbys is N. 😌

Which means β€” and this is the part you actually need to know, bestie β€” to be able to run the following command, at least 3 standby nodes with a non-zero candidate priority must be registered to the monitor:

$ pg_autoctl set formation number-sync-standbys 2

it's giving "do the math before you do the command." N is 2, so you need 2+1 = 3 eligible standbys, no cap. πŸ”₯

Also, go look at pg_autoctl show settings for the full list of replication settings β€” that's where the whole menu lives. πŸ‘‘


πŸ’– OPTIONS πŸ’–

  • --pgdata β€” 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. 🫢
  • --json β€” Output JSON formatted data. that's it, that's the whole thing. structured data supremacy ✨
  • --formation β€” Show replication settings for given formation. Defaults to default. yes bestie, it really does just say default.

🌈 ENVIRONMENT 🌈

  • PGDATA β€” Postgres directory location. Can be used instead of the --pgdata option. same energy, different door.
  • 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. the whole author section. one word. iconic behaviour, honestly. πŸ’œ


Copyright (c) Microsoft Corporation. All rights reserved.


and that's the page, bestie!! this one came to you from pg_auto_failover, version 2.2, dated Apr 07, 2025 β€” manual section 1, sync-standbys, and she ate. πŸŽ€βœ¨πŸ¦‹πŸŒΈπŸ’–

πŸ“¦ where this page comes from