@@ -942,6 +942,7 @@ GRANT SELECT ON TABLE pg_catalog.pg_namespace TO backup;
942
942
GRANT SELECT ON TABLE pg_catalog.pg_extension TO backup;
943
943
GRANT EXECUTE ON FUNCTION bt_index_check(regclass) TO backup;
944
944
GRANT EXECUTE ON FUNCTION bt_index_check(regclass, bool) TO backup;
945
+ GRANT EXECUTE ON FUNCTION bt_index_check(regclass, bool, bool) TO backup;
945
946
</programlisting >
946
947
</refsect2 >
947
948
<refsect2 id =" pbk-setting-up-partial-restore" >
@@ -3527,6 +3528,14 @@ pg_probackup catchup -b <replaceable>catchup_mode</replaceable> --source-pgdata=
3527
3528
of threads with the <option >--threads</option > option:
3528
3529
<programlisting >
3529
3530
pg_probackup catchup -b <replaceable >catchup_mode</replaceable > --source-pgdata=<replaceable >path_to_pgdata_on_remote_server</replaceable > --destination-pgdata=<replaceable >path_to_local_dir</replaceable > --stream --threads=<replaceable >num_threads</replaceable >
3531
+ </programlisting >
3532
+ </para >
3533
+ <para >
3534
+ Before cloning/synchronising a <productname >PostgreSQL</productname > instance, you can run the
3535
+ <command >catchup</command > command with the <option >--dry-run</option > flag
3536
+ to estimate the size of data files to be transferred, but make no changes on disk:
3537
+ <programlisting >
3538
+ pg_probackup catchup -b <replaceable >catchup_mode</replaceable > --source-pgdata=<replaceable >path_to_pgdata_on_remote_server</replaceable > --destination-pgdata=<replaceable >path_to_local_dir</replaceable > --stream --dry-run
3530
3539
</programlisting >
3531
3540
</para >
3532
3541
<para >
@@ -3540,7 +3549,7 @@ pg_probackup catchup --source-pgdata=/master-pgdata --destination-pgdata=/replic
3540
3549
<para >
3541
3550
Another example shows how you can add a new remote standby server with the <productname >PostgreSQL</productname > data directory <filename >/replica-pgdata</filename > by running the <command >catchup</command > command in the <literal >FULL</literal > mode
3542
3551
on four parallel threads:
3543
- <programlisting >
3552
+ <programlisting >
3544
3553
pg_probackup catchup --source-pgdata=/master-pgdata --destination-pgdata=/replica-pgdata -p 5432 -d postgres -U remote-postgres-user --stream --backup-mode=FULL --remote-host=remote-hostname --remote-user=remote-unix-username -j 4
3545
3554
</programlisting >
3546
3555
</para >
@@ -4141,7 +4150,7 @@ pg_probackup restore -B <replaceable>backup_dir</replaceable> --instance <replac
4141
4150
pg_probackup checkdb
4142
4151
[-B <replaceable >backup_dir</replaceable >] [--instance <replaceable >instance_name</replaceable >] [-D <replaceable >data_dir</replaceable >]
4143
4152
[--help] [-j <replaceable >num_threads</replaceable >] [--progress]
4144
- [--skip-block-validation] [--amcheck ] [--heapallindexed]
4153
+ [--amcheck [-- skip-block-validation] [--checkunique ] [--heapallindexed] ]
4145
4154
[<replaceable >connection_options</replaceable >] [<replaceable >logging_options</replaceable >]
4146
4155
</programlisting >
4147
4156
<para >
@@ -4156,21 +4165,30 @@ pg_probackup checkdb
4156
4165
<para >
4157
4166
Performs logical verification of indexes for the specified
4158
4167
<productname >PostgreSQL</productname > instance if no corruption was found while checking
4159
- data files. You must have the <application >amcheck</application >
4168
+ data files. You must have the <ulink url = " https://postgrespro.com/docs/enterprise/current/amcheck.html " >< application >amcheck</application ></ ulink >
4160
4169
extension or the <application >amcheck_next</application > extension
4161
4170
installed in the database to check its indexes. For databases
4162
4171
without <application >amcheck</application >, index verification will be skipped.
4172
+ Additional options <option >--checkunique</option > and <option >--heapallindexed</option >
4173
+ are effective depending on the version of <application >amcheck</application > installed.
4163
4174
</para >
4164
4175
</listitem >
4165
4176
</varlistentry >
4166
4177
4167
4178
<varlistentry >
4168
- <term ><option >--skip-block-validation </option ></term >
4179
+ <term ><option >--checkunique </option ></term >
4169
4180
<listitem >
4170
4181
<para >
4171
- Skip validation of data files. You can use this flag only
4172
- together with the <option >--amcheck</option > flag, so that only logical
4173
- verification of indexes is performed.
4182
+ Verifies unique constraints during logical verification of indexes.
4183
+ You can use this flag only together with the <option >--amcheck</option > flag when
4184
+ the <application >amcheck</application > extension is
4185
+ installed in the database.
4186
+ </para >
4187
+ <para >
4188
+ The verification of unique constraints is only possible if in the version of the
4189
+ <application >amcheck</application > extension you are using, the
4190
+ <function >bt_index_check</function > function takes the
4191
+ <parameter >checkunique</parameter > parameter.
4174
4192
</para >
4175
4193
</listitem >
4176
4194
</varlistentry >
@@ -4184,12 +4202,25 @@ pg_probackup checkdb
4184
4202
<option >--amcheck</option > flag.
4185
4203
</para >
4186
4204
<para >
4187
- This check is only possible if you are using the
4188
- <application >amcheck</application > extension of version 2.0 or higher, or
4189
- the <application >amcheck_next</application > extension of any version.
4205
+ This check is only possible if in the version of the
4206
+ <application >amcheck</application >/<application >amcheck_next</application > extension
4207
+ you are using, the <function >bt_index_check</function >
4208
+ function takes the <parameter >heapallindexed</parameter > parameter.
4209
+ </para >
4210
+ </listitem >
4211
+ </varlistentry >
4212
+ <varlistentry >
4213
+
4214
+ <term ><option >--skip-block-validation</option ></term >
4215
+ <listitem >
4216
+ <para >
4217
+ Skip validation of data files. You can use this flag only
4218
+ together with the <option >--amcheck</option > flag, so that only logical
4219
+ verification of indexes is performed.
4190
4220
</para >
4191
4221
</listitem >
4192
4222
</varlistentry >
4223
+
4193
4224
</variablelist >
4194
4225
</para >
4195
4226
<para >
@@ -4424,7 +4455,7 @@ pg_probackup archive-get -B <replaceable>backup_dir</replaceable> --instance <re
4424
4455
pg_probackup catchup -b <replaceable >catchup_mode</replaceable >
4425
4456
--source-pgdata=<replaceable >path_to_pgdata_on_remote_server</replaceable >
4426
4457
--destination-pgdata=<replaceable >path_to_local_dir</replaceable >
4427
- [--help] [-j | --threads=<replaceable >num_threads</replaceable >] [--stream]
4458
+ [--help] [-j | --threads=<replaceable >num_threads</replaceable >] [--stream] [--dry-run]
4428
4459
[--temp-slot] [-P | --perm-slot] [-S | --slot=<replaceable >slot_name</replaceable >]
4429
4460
[--exclude-path=<replaceable >PATHNAME</replaceable >]
4430
4461
[-T <replaceable >OLDDIR</replaceable >=<replaceable >NEWDIR</replaceable >]
@@ -4513,6 +4544,19 @@ pg_probackup catchup -b <replaceable>catchup_mode</replaceable>
4513
4544
</listitem >
4514
4545
</varlistentry >
4515
4546
4547
+ <varlistentry >
4548
+ <term ><option >--dry-run</option ></term >
4549
+ <listitem >
4550
+ <para >
4551
+ Displays the total size of the files to be transferred by <command >catchup</command >.
4552
+ This flag initiates a trial run of <command >catchup</command >, which does
4553
+ not actually create, delete or move files on disk. WAL streaming is skipped with <option >--dry-run</option >.
4554
+ This flag also allows you to check that
4555
+ all the options are correct and cloning/synchronising is ready to run.
4556
+ </para >
4557
+ </listitem >
4558
+ </varlistentry >
4559
+
4516
4560
<varlistentry >
4517
4561
<term ><option >-x</option >=<replaceable >path_prefix</replaceable ></term >
4518
4562
<term ><option >--exclude-path</option >=<replaceable >path_prefix</replaceable ></term >
@@ -4533,17 +4577,6 @@ pg_probackup catchup -b <replaceable>catchup_mode</replaceable>
4533
4577
</listitem >
4534
4578
</varlistentry >
4535
4579
4536
- <varlistentry >
4537
- <term ><option >--stream</option ></term >
4538
- <listitem >
4539
- <para >
4540
- Copies the instance in <link linkend =" pbk-stream-mode" >STREAM</link > WAL delivery mode,
4541
- including all the necessary WAL files by streaming them from
4542
- the instance server via replication protocol.
4543
- </para >
4544
- </listitem >
4545
- </varlistentry >
4546
-
4547
4580
<varlistentry >
4548
4581
<term ><option >--temp-slot</option ></term >
4549
4582
<listitem >