@@ -889,8 +889,11 @@ SELECT pg_start_backup('label', false, false);
889889<programlisting>
890890SELECT * FROM pg_stop_backup(false, true);
891891</programlisting>
892- This terminates the backup mode and performs an automatic switch to
893- the next WAL segment. The reason for the switch is to arrange for
892+ This terminates backup mode. On a primary, it also performs an automatic
893+ switch to the next WAL segment. On a standby, it is not possible to
894+ automatically switch WAL segments, so you may wish to run
895+ <function>pg_switch_wal</function> on the primary to perform a manual
896+ switch. The reason for the switch is to arrange for
894897 the last WAL segment file written during the backup interval to be
895898 ready to archive.
896899 </para>
@@ -908,9 +911,12 @@ SELECT * FROM pg_stop_backup(false, true);
908911 Once the WAL segment files active during the backup are archived, you are
909912 done. The file identified by <function>pg_stop_backup</>'s first return
910913 value is the last segment that is required to form a complete set of
911- backup files. If <varname>archive_mode</> is enabled,
914+ backup files. On a primary, if <varname>archive_mode</> is enabled and the
915+ <literal>wait_for_archive</> parameter is <literal>true</>,
912916 <function>pg_stop_backup</> does not return until the last segment has
913917 been archived.
918+ On a standby, <varname>archive_mode</> must be <literal>always</> in order
919+ for <function>pg_stop_backup</> to wait.
914920 Archiving of these files happens automatically since you have
915921 already configured <varname>archive_command</>. In most cases this
916922 happens quickly, but you are advised to monitor your archive
@@ -926,8 +932,9 @@ SELECT * FROM pg_stop_backup(false, true);
926932 </para>
927933 <para>
928934 If the backup process monitors and ensures that all WAL segment files
929- required for the backup are successfully archived then the second
930- parameter (which defaults to true) can be set to false to have
935+ required for the backup are successfully archived then the
936+ <literal>wait_for_archive</> parameter (which defaults to true) can be set
937+ to false to have
931938 <function>pg_stop_backup</> return as soon as the stop backup record is
932939 written to the WAL. By default, <function>pg_stop_backup</> will wait
933940 until all WAL has been archived, which can take some time. This option
@@ -943,9 +950,9 @@ SELECT * FROM pg_stop_backup(false, true);
943950 <title>Making an exclusive low level backup</title>
944951 <para>
945952 The process for an exclusive backup is mostly the same as for a
946- non-exclusive one, but it differs in a few key steps. It does not allow
947- more than one concurrent backup to run, and there can be some issues on
948- the server if it crashes during the backup. Prior to PostgreSQL 9.6, this
953+ non-exclusive one, but it differs in a few key steps. This type of backup
954+ can only be taken on a primary and does not allow concurrent backups.
955+ Prior to <productname> PostgreSQL</> 9.6, this
949956 was the only low-level method available, but it is now recommended that
950957 all users upgrade their scripts to use non-exclusive backups if possible.
951958 </para>
@@ -1003,6 +1010,11 @@ SELECT pg_start_backup('label', true);
10031010 <xref linkend="backup-lowlevel-base-backup-data"> for things to
10041011 consider during this backup.
10051012 </para>
1013+ <para>
1014+ Note that if the server crashes during the backup it may not be
1015+ possible to restart until the <literal>backup_label</> file has been
1016+ manually deleted from the <envar>PGDATA</envar> directory.
1017+ </para>
10061018 </listitem>
10071019 <listitem>
10081020 <para>
@@ -1012,15 +1024,10 @@ SELECT pg_start_backup('label', true);
10121024<programlisting>
10131025SELECT pg_stop_backup();
10141026</programlisting>
1015- This function, when called on a primary, terminates the backup mode and
1027+ This function terminates backup mode and
10161028 performs an automatic switch to the next WAL segment. The reason for the
10171029 switch is to arrange for the last WAL segment written during the backup
1018- interval to be ready to archive. When called on a standby, this function
1019- only terminates backup mode. A subsequent WAL segment switch will be
1020- needed in order to ensure that all WAL files needed to restore the backup
1021- can be archived; if the primary does not have sufficient write activity
1022- to trigger one, <function>pg_switch_wal</function> should be executed on
1023- the primary.
1030+ interval to be ready to archive.
10241031 </para>
10251032 </listitem>
10261033 <listitem>
0 commit comments