From 19ef55a0dd6a86d08633428ea46d2dc194c84be3 Mon Sep 17 00:00:00 2001
From: Rushabh Lathia <rushabh.lathia@enterprisedb.com>
Date: Fri, 22 Nov 2019 15:18:15 +0530
Subject: [PATCH 4/5] Documentation for backup manifest and manifest-checksums
 option.

---
 doc/src/sgml/protocol.sgml          | 24 +++++++++++++++++++++---
 doc/src/sgml/ref/pg_basebackup.sgml | 12 ++++++++++++
 2 files changed, 33 insertions(+), 3 deletions(-)

diff --git a/doc/src/sgml/protocol.sgml b/doc/src/sgml/protocol.sgml
index 8027521..bdff6f5 100644
--- a/doc/src/sgml/protocol.sgml
+++ b/doc/src/sgml/protocol.sgml
@@ -2466,15 +2466,19 @@ The commands accepted in replication mode are:
   </varlistentry>
 
   <varlistentry>
-    <term><literal>BASE_BACKUP</literal> [ <literal>LABEL</literal> <replaceable>'label'</replaceable> ] [ <literal>PROGRESS</literal> ] [ <literal>FAST</literal> ] [ <literal>WAL</literal> ] [ <literal>NOWAIT</literal> ] [ <literal>MAX_RATE</literal> <replaceable>rate</replaceable> ] [ <literal>TABLESPACE_MAP</literal> ] [ <literal>NOVERIFY_CHECKSUMS</literal> ]
+    <term><literal>BASE_BACKUP</literal> [ <literal>LABEL</literal> <replaceable>'label'</replaceable> ] [ <literal>PROGRESS</literal> ] [ <literal>FAST</literal> ] [ <literal>WAL</literal> ] [ <literal>NOWAIT</literal> ] [ <literal>MAX_RATE</literal> <replaceable>rate</replaceable> ] [ <literal>TABLESPACE_MAP</literal> ] [ <literal>NOVERIFY_CHECKSUMS</literal> ] [ <literal>MANIFEST_CHECKSUMS</literal> <replaceable>'algorithm'</replaceable>]
      <indexterm><primary>BASE_BACKUP</primary></indexterm>
     </term>
     <listitem>
      <para>
       Instructs the server to start streaming a base backup.
       The system will automatically be put in backup mode before the backup
-      is started, and taken out of it when the backup is complete. The
-      following options are accepted:
+      is started, and taken out of it when the backup is complete.  This also
+      store a manifest as part of each backup under the backup folder in a
+      file named backup_manifest.  This file contains the list of files, and
+      the lengths of those files, file modified time and optional checksum
+      for each file as well as for a manifest file.The following options are
+      accepted:
       <variablelist>
        <varlistentry>
         <term><literal>LABEL</literal> <replaceable>'label'</replaceable></term>
@@ -2576,6 +2580,20 @@ The commands accepted in replication mode are:
          </para>
         </listitem>
        </varlistentry>
+
+       <varlistentry>
+        <term><literal>MANIFEST_CHECKSUMS</literal></term>
+        <listitem>
+         <para>
+          By default, checksum for each backup file in backup manifest file is
+          off. Specifying <literal>MANIFEST_CHECKSUMS</literal> when a checksum
+          algorithm name, enables the checksum for each backup file in backup
+          manifest file as well a for manifest file itself. Currently it supports
+          SHA256 and CRC32C as checksum algorithm.
+         </para>
+        </listitem>
+       </varlistentry>
+
       </variablelist>
      </para>
      <para>
diff --git a/doc/src/sgml/ref/pg_basebackup.sgml b/doc/src/sgml/ref/pg_basebackup.sgml
index fc9e222..af7c731 100644
--- a/doc/src/sgml/ref/pg_basebackup.sgml
+++ b/doc/src/sgml/ref/pg_basebackup.sgml
@@ -536,6 +536,18 @@ PostgreSQL documentation
        </para>
       </listitem>
      </varlistentry>
+
+     <varlistentry>
+      <term><option>--manifest-checksum <replaceable class="parameter">algorithm</replaceable></option></term>
+      <listitem>
+       <para>
+        Enables a checksum for the each backup file in manifest file as well as
+        for manifest file itself and will choose the given algorithm to generate
+        the checksum value.
+       </para>
+      </listitem>
+     </varlistentry>
+
     </variablelist>
    </para>
 
-- 
1.8.3.1

