.\" Man page generated from reStructuredText. . . .nr rst2man-indent-level 0 . .de1 rstReportMargin \\$1 \\n[an-margin] level \\n[rst2man-indent-level] level margin: \\n[rst2man-indent\\n[rst2man-indent-level]] - \\n[rst2man-indent0] \\n[rst2man-indent1] \\n[rst2man-indent2] .. .de1 INDENT .\" .rstReportMargin pre: . RS \\$1 . nr rst2man-indent\\n[rst2man-indent-level] \\n[an-margin] . nr rst2man-indent-level +1 .\" .rstReportMargin post: .. .de UNINDENT . RE .\" indent \\n[an-margin] .\" old: \\n[rst2man-indent\\n[rst2man-indent-level]] .nr rst2man-indent-level -1 .\" new: \\n[rst2man-indent\\n[rst2man-indent-level]] .in \\n[rst2man-indent\\n[rst2man-indent-level]]u .. .TH "PG_AUTOCTL PERFORM SWITCHOVER" "1" "Nov 06, 2022" "2.0" "pg_auto_failover" .SH NAME pg_autoctl perform switchover \- pg_autoctl perform switchover .sp pg_autoctl perform switchover \- Perform a switchover for given formation and group .SH SYNOPSIS .sp This command starts a Postgres switchover orchestration from the pg_auto_switchover monitor: .INDENT 0.0 .INDENT 3.5 .sp .nf .ft C usage: pg_autoctl perform switchover [ \-\-pgdata \-\-formation \-\-group ] \-\-pgdata path to data directory \-\-formation formation to target, defaults to \(aqdefault\(aq \-\-group group to target, defaults to 0 .ft P .fi .UNINDENT .UNINDENT .SH DESCRIPTION .sp The pg_auto_switchover monitor can be used to orchestrate a manual switchover, sometimes also known as a switchover. When doing so, split\-brain are prevented thanks to intermediary states being used in the Finite State Machine. .sp The \fBpg_autoctl perform switchover\fP command waits until the switchover is known complete on the monitor, or until the hard\-coded 60s timeout has passed. .sp The switchover orchestration is done in the background by the monitor, so even if the \fBpg_autoctl perform switchover\fP stops on the timeout, the switchover orchestration continues at the monitor. .sp See also \fI\%pg_autoctl perform failover\fP, a synonym for this command. .SH OPTIONS .INDENT 0.0 .TP .B \-\-pgdata Location of the Postgres node being managed locally. Defaults to the environment variable \fBPGDATA\fP\&. Use \fB\-\-monitor\fP to connect to a monitor from anywhere, rather than the monitor URI used by a local Postgres node managed with \fBpg_autoctl\fP\&. .TP .B \-\-formation Formation to target for the operation. Defaults to \fBdefault\fP\&. .TP .B \-\-group Postgres group to target for the operation. Defaults to \fB0\fP, only Citus formations may have more than one group. .UNINDENT .SH ENVIRONMENT .sp PGDATA .INDENT 0.0 .INDENT 3.5 Postgres directory location. Can be used instead of the \fB\-\-pgdata\fP option. .UNINDENT .UNINDENT .sp PG_AUTOCTL_MONITOR .INDENT 0.0 .INDENT 3.5 Postgres URI to connect to the monitor node, can be used instead of the \fB\-\-monitor\fP option. .UNINDENT .UNINDENT .sp PG_CONFIG .INDENT 0.0 .INDENT 3.5 Can be set to the absolute path to the \fI\%pg_config\fP Postgres tool. This is mostly used in the context of building extensions, though it can be a useful way to select a Postgres version when several are installed on the same system. .UNINDENT .UNINDENT .sp PATH .INDENT 0.0 .INDENT 3.5 Used the usual way mostly. Some entries that are searched in the PATH by the \fBpg_autoctl\fP command are expected to be found only once, to avoid mistakes with Postgres major versions. .UNINDENT .UNINDENT .sp PGHOST, PGPORT, PGDATABASE, PGUSER, PGCONNECT_TIMEOUT, ... .INDENT 0.0 .INDENT 3.5 See the \fI\%Postgres docs about Environment Variables\fP for details. .UNINDENT .UNINDENT .sp TMPDIR .INDENT 0.0 .INDENT 3.5 The pgcopydb command creates all its work files and directories in \fB${TMPDIR}/pgcopydb\fP, and defaults to \fB/tmp/pgcopydb\fP\&. .UNINDENT .UNINDENT .sp XDG_CONFIG_HOME .INDENT 0.0 .INDENT 3.5 The pg_autoctl command stores its configuration files in the standard place XDG_CONFIG_HOME. See the \fI\%XDG Base Directory Specification\fP\&. .UNINDENT .UNINDENT .sp XDG_DATA_HOME .INDENT 0.0 .INDENT 3.5 The pg_autoctl command stores its internal states files in the standard place XDG_DATA_HOME, which defaults to \fB~/.local/share\fP\&. See the \fI\%XDG Base Directory Specification\fP\&. .UNINDENT .UNINDENT .SH AUTHOR Microsoft .SH COPYRIGHT Copyright (c) Microsoft Corporation. All rights reserved. .\" Generated by docutils manpage writer. .