@@ -942,6 +942,7 @@ GRANT SELECT ON TABLE pg_catalog.pg_namespace TO backup;
942942GRANT SELECT ON TABLE pg_catalog.pg_extension TO backup;
943943GRANT EXECUTE ON FUNCTION bt_index_check(regclass) TO backup;
944944GRANT EXECUTE ON FUNCTION bt_index_check(regclass, bool) TO backup;
945+ GRANT EXECUTE ON FUNCTION bt_index_check(regclass, bool, bool) TO backup;
945946</programlisting >
946947 </refsect2 >
947948 <refsect2 id =" pbk-setting-up-partial-restore" >
@@ -3527,6 +3528,14 @@ pg_probackup catchup -b <replaceable>catchup_mode</replaceable> --source-pgdata=
35273528 of threads with the <option >--threads</option > option:
35283529 <programlisting >
35293530pg_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
35303539</programlisting >
35313540 </para >
35323541 <para >
@@ -3540,7 +3549,7 @@ pg_probackup catchup --source-pgdata=/master-pgdata --destination-pgdata=/replic
35403549 <para >
35413550 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
35423551 on four parallel threads:
3543- <programlisting >
3552+ <programlisting >
35443553pg_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
35453554</programlisting >
35463555 </para >
@@ -4141,7 +4150,7 @@ pg_probackup restore -B <replaceable>backup_dir</replaceable> --instance <replac
41414150pg_probackup checkdb
41424151[-B <replaceable >backup_dir</replaceable >] [--instance <replaceable >instance_name</replaceable >] [-D <replaceable >data_dir</replaceable >]
41434152[--help] [-j <replaceable >num_threads</replaceable >] [--progress]
4144- [--skip-block-validation] [--amcheck ] [--heapallindexed]
4153+ [--amcheck [-- skip-block-validation] [--checkunique ] [--heapallindexed] ]
41454154[<replaceable >connection_options</replaceable >] [<replaceable >logging_options</replaceable >]
41464155</programlisting >
41474156 <para >
@@ -4156,21 +4165,30 @@ pg_probackup checkdb
41564165 <para >
41574166 Performs logical verification of indexes for the specified
41584167 <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 >
41604169 extension or the <application >amcheck_next</application > extension
41614170 installed in the database to check its indexes. For databases
41624171 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.
41634174 </para >
41644175 </listitem >
41654176 </varlistentry >
41664177
41674178 <varlistentry >
4168- <term ><option >--skip-block-validation </option ></term >
4179+ <term ><option >--checkunique </option ></term >
41694180 <listitem >
41704181 <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.
41744192 </para >
41754193 </listitem >
41764194 </varlistentry >
@@ -4184,12 +4202,25 @@ pg_probackup checkdb
41844202 <option >--amcheck</option > flag.
41854203 </para >
41864204 <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.
41904220 </para >
41914221 </listitem >
41924222 </varlistentry >
4223+
41934224 </variablelist >
41944225 </para >
41954226 <para >
@@ -4424,7 +4455,7 @@ pg_probackup archive-get -B <replaceable>backup_dir</replaceable> --instance <re
44244455pg_probackup catchup -b <replaceable >catchup_mode</replaceable >
44254456--source-pgdata=<replaceable >path_to_pgdata_on_remote_server</replaceable >
44264457--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]
44284459[--temp-slot] [-P | --perm-slot] [-S | --slot=<replaceable >slot_name</replaceable >]
44294460[--exclude-path=<replaceable >PATHNAME</replaceable >]
44304461[-T <replaceable >OLDDIR</replaceable >=<replaceable >NEWDIR</replaceable >]
@@ -4513,6 +4544,19 @@ pg_probackup catchup -b <replaceable>catchup_mode</replaceable>
45134544 </listitem >
45144545 </varlistentry >
45154546
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+
45164560 <varlistentry >
45174561<term ><option >-x</option >=<replaceable >path_prefix</replaceable ></term >
45184562<term ><option >--exclude-path</option >=<replaceable >path_prefix</replaceable ></term >
@@ -4533,17 +4577,6 @@ pg_probackup catchup -b <replaceable>catchup_mode</replaceable>
45334577 </listitem >
45344578 </varlistentry >
45354579
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-
45474580 <varlistentry >
45484581<term ><option >--temp-slot</option ></term >
45494582 <listitem >