@@ -25618,9 +25618,8 @@ LOG: Grand total: 1651920 bytes in 201 blocks; 622360 free (88 chunks); 1029560
25618
25618
The functions shown in <xref
25619
25619
linkend="functions-admin-backup-table"/> assist in making on-line backups.
25620
25620
These functions cannot be executed during recovery (except
25621
- non-exclusive <function>pg_start_backup</function>,
25622
- non-exclusive <function>pg_stop_backup</function>,
25623
- <function>pg_is_in_backup</function>, <function>pg_backup_start_time</function>
25621
+ <function>pg_backup_start</function>,
25622
+ <function>pg_backup_stop</function>,
25624
25623
and <function>pg_wal_lsn_diff</function>).
25625
25624
</para>
25626
25625
@@ -25709,13 +25708,12 @@ LOG: Grand total: 1651920 bytes in 201 blocks; 622360 free (88 chunks); 1029560
25709
25708
<row>
25710
25709
<entry role="func_table_entry"><para role="func_signature">
25711
25710
<indexterm>
25712
- <primary>pg_start_backup </primary>
25711
+ <primary>pg_backup_start </primary>
25713
25712
</indexterm>
25714
- <function>pg_start_backup </function> (
25713
+ <function>pg_backup_start </function> (
25715
25714
<parameter>label</parameter> <type>text</type>
25716
25715
<optional>, <parameter>fast</parameter> <type>boolean</type>
25717
- <optional>, <parameter>exclusive</parameter> <type>boolean</type>
25718
- </optional></optional> )
25716
+ </optional> )
25719
25717
<returnvalue>pg_lsn</returnvalue>
25720
25718
</para>
25721
25719
<para>
@@ -25724,23 +25722,9 @@ LOG: Grand total: 1651920 bytes in 201 blocks; 622360 free (88 chunks); 1029560
25724
25722
(Typically this would be the name under which the backup dump file
25725
25723
will be stored.)
25726
25724
If the optional second parameter is given as <literal>true</literal>,
25727
- it specifies executing <function>pg_start_backup </function> as quickly
25725
+ it specifies executing <function>pg_backup_start </function> as quickly
25728
25726
as possible. This forces an immediate checkpoint which will cause a
25729
25727
spike in I/O operations, slowing any concurrently executing queries.
25730
- The optional third parameter specifies whether to perform an exclusive
25731
- or non-exclusive backup (default is exclusive).
25732
- </para>
25733
- <para>
25734
- When used in exclusive mode, this function writes a backup label file
25735
- (<filename>backup_label</filename>) and, if there are any links in
25736
- the <filename>pg_tblspc/</filename> directory, a tablespace map file
25737
- (<filename>tablespace_map</filename>) into the database cluster's data
25738
- directory, then performs a checkpoint, and then returns the backup's
25739
- starting write-ahead log location. (The user can ignore this
25740
- result value, but it is provided in case it is useful.) When used in
25741
- non-exclusive mode, the contents of these files are instead returned
25742
- by the <function>pg_stop_backup</function> function, and should be
25743
- copied to the backup area by the user.
25744
25728
</para>
25745
25729
<para>
25746
25730
This function is restricted to superusers by default, but other users
@@ -25751,36 +25735,32 @@ LOG: Grand total: 1651920 bytes in 201 blocks; 622360 free (88 chunks); 1029560
25751
25735
<row>
25752
25736
<entry role="func_table_entry"><para role="func_signature">
25753
25737
<indexterm>
25754
- <primary>pg_stop_backup </primary>
25738
+ <primary>pg_backup_stop </primary>
25755
25739
</indexterm>
25756
- <function>pg_stop_backup</function> (
25757
- <parameter>exclusive</parameter> <type>boolean</type>
25758
- <optional>, <parameter>wait_for_archive</parameter> <type>boolean</type>
25740
+ <function>pg_backup_stop</function> (
25741
+ <optional><parameter>wait_for_archive</parameter> <type>boolean</type>
25759
25742
</optional> )
25760
25743
<returnvalue>record</returnvalue>
25761
25744
( <parameter>lsn</parameter> <type>pg_lsn</type>,
25762
25745
<parameter>labelfile</parameter> <type>text</type>,
25763
25746
<parameter>spcmapfile</parameter> <type>text</type> )
25764
25747
</para>
25765
25748
<para>
25766
- Finishes performing an exclusive or non-exclusive on-line backup.
25767
- The <parameter>exclusive</parameter> parameter must match the
25768
- previous <function>pg_start_backup</function> call.
25769
- In an exclusive backup, <function>pg_stop_backup</function> removes
25770
- the backup label file and, if it exists, the tablespace map file
25771
- created by <function>pg_start_backup</function>. In a non-exclusive
25772
- backup, the desired contents of these files are returned as part of
25773
- the result of the function, and should be written to files in the
25774
- backup area (not in the data directory).
25749
+ Finishes performing an on-line backup. The desired contents of the
25750
+ backup label file and the tablespace map file are returned as part of
25751
+ the result of the function and must be written to files in the
25752
+ backup area. These files must not be written to the live data directory
25753
+ (doing so will cause PostgreSQL to fail to restart in the event of a
25754
+ crash).
25775
25755
</para>
25776
25756
<para>
25777
- There is an optional second parameter of type <type>boolean</type>.
25757
+ There is an optional parameter of type <type>boolean</type>.
25778
25758
If false, the function will return immediately after the backup is
25779
25759
completed, without waiting for WAL to be archived. This behavior is
25780
25760
only useful with backup software that independently monitors WAL
25781
25761
archiving. Otherwise, WAL required to make the backup consistent might
25782
25762
be missing and make the backup useless. By default or when this
25783
- parameter is true, <function>pg_stop_backup </function> will wait for
25763
+ parameter is true, <function>pg_backup_stop </function> will wait for
25784
25764
WAL to be archived when archiving is enabled. (On a standby, this
25785
25765
means that it will wait only when <varname>archive_mode</varname> =
25786
25766
<literal>always</literal>. If write activity on the primary is low,
@@ -25790,7 +25770,7 @@ LOG: Grand total: 1651920 bytes in 201 blocks; 622360 free (88 chunks); 1029560
25790
25770
<para>
25791
25771
When executed on a primary, this function also creates a backup
25792
25772
history file in the write-ahead log archive area. The history file
25793
- includes the label given to <function>pg_start_backup </function>, the
25773
+ includes the label given to <function>pg_backup_start </function>, the
25794
25774
starting and ending write-ahead log locations for the backup, and the
25795
25775
starting and ending times of the backup. After recording the ending
25796
25776
location, the current write-ahead log insertion point is automatically
@@ -25801,61 +25781,18 @@ LOG: Grand total: 1651920 bytes in 201 blocks; 622360 free (88 chunks); 1029560
25801
25781
<para>
25802
25782
The result of the function is a single record.
25803
25783
The <parameter>lsn</parameter> column holds the backup's ending
25804
- write-ahead log location (which again can be ignored). The second and
25805
- third columns are <literal>NULL</literal> when ending an exclusive
25806
- backup; after a non-exclusive backup they hold the desired contents of
25807
- the label and tablespace map files.
25808
- </para>
25809
- <para>
25810
- This function is restricted to superusers by default, but other users
25811
- can be granted EXECUTE to run the function.
25812
- </para></entry>
25813
- </row>
25814
-
25815
- <row>
25816
- <entry role="func_table_entry"><para role="func_signature">
25817
- <function>pg_stop_backup</function> ()
25818
- <returnvalue>pg_lsn</returnvalue>
25819
- </para>
25820
- <para>
25821
- Finishes performing an exclusive on-line backup. This simplified
25822
- version is equivalent to <literal>pg_stop_backup(true,
25823
- true)</literal>, except that it only returns the <type>pg_lsn</type>
25824
- result.
25784
+ write-ahead log location (which again can be ignored). The second
25785
+ column returns the contents of the backup label file, and the third
25786
+ column returns the contents of the tablespace map file. These must be
25787
+ stored as part of the backup and are required as part of the restore
25788
+ process.
25825
25789
</para>
25826
25790
<para>
25827
25791
This function is restricted to superusers by default, but other users
25828
25792
can be granted EXECUTE to run the function.
25829
25793
</para></entry>
25830
25794
</row>
25831
25795
25832
- <row>
25833
- <entry role="func_table_entry"><para role="func_signature">
25834
- <indexterm>
25835
- <primary>pg_is_in_backup</primary>
25836
- </indexterm>
25837
- <function>pg_is_in_backup</function> ()
25838
- <returnvalue>boolean</returnvalue>
25839
- </para>
25840
- <para>
25841
- Returns true if an on-line exclusive backup is in progress.
25842
- </para></entry>
25843
- </row>
25844
-
25845
- <row>
25846
- <entry role="func_table_entry"><para role="func_signature">
25847
- <indexterm>
25848
- <primary>pg_backup_start_time</primary>
25849
- </indexterm>
25850
- <function>pg_backup_start_time</function> ()
25851
- <returnvalue>timestamp with time zone</returnvalue>
25852
- </para>
25853
- <para>
25854
- Returns the start time of the current on-line exclusive backup if one
25855
- is in progress, otherwise <literal>NULL</literal>.
25856
- </para></entry>
25857
- </row>
25858
-
25859
25796
<row>
25860
25797
<entry role="func_table_entry"><para role="func_signature">
25861
25798
<indexterm>
@@ -25953,7 +25890,7 @@ LOG: Grand total: 1651920 bytes in 201 blocks; 622360 free (88 chunks); 1029560
25953
25890
corresponding write-ahead log file name and byte offset from
25954
25891
a <type>pg_lsn</type> value. For example:
25955
25892
<programlisting>
25956
- postgres=# SELECT * FROM pg_walfile_name_offset(pg_stop_backup() );
25893
+ postgres=# SELECT * FROM pg_walfile_name_offset((pg_backup_stop()).lsn );
25957
25894
file_name | file_offset
25958
25895
--------------------------+-------------
25959
25896
00000001000000000000000D | 4039624
0 commit comments