From 0fc5ea63d7a2700ea841c56dc766a11d8f4182ff Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Mart=C3=ADn=20Marqu=C3=A9s?= <martin.marques@gmail.com>
Date: Tue, 9 Apr 2024 09:34:21 +0200
Subject: [PATCH 2/2] Add note of restrictions for combining incremental
 backups

When taking incremental backups the user must be warned that the
backup format has to be plain for pg_combinebackup to work properly.

Another thing to consider is if a cluster had checksums enabled after
the previous backup, an incremental backup will yield a possible
valid cluster but with files from the previous backup that don't have
checksums, giving checksum errors when replying subsequent changes to
those blocks. This behavior was brought up by Tomas Vondra while
testing.
---
 doc/src/sgml/ref/pg_combinebackup.sgml | 21 +++++++++++++++++++++
 1 file changed, 21 insertions(+)

diff --git a/doc/src/sgml/ref/pg_combinebackup.sgml b/doc/src/sgml/ref/pg_combinebackup.sgml
index 19b6d159ce..1cafc0ab07 100644
--- a/doc/src/sgml/ref/pg_combinebackup.sgml
+++ b/doc/src/sgml/ref/pg_combinebackup.sgml
@@ -60,6 +60,27 @@ PostgreSQL documentation
    be specified on the command line in lieu of the chain of backups from which
    it was reconstructed.
   </para>
+
+  <para>
+   Note that there are limitations in combining backups:
+   <itemizedlist>
+    <listitem>
+     <para>
+      <application>pg_combinebackup</application> works with plain format only.
+      In order to combine backups in tar format, they need to be untar first.
+     </para>
+    </listitem>
+    <listitem>
+     <para>
+      If an incremental backup is taken from a cluster where checksums were enabled
+      after the reference backup finished, the resulting data may be valid, but
+      the checksums wouldn't validate for files from the reference backup.
+      In case of enabling checksums on an existing cluster, the next backup must be
+      a full backup.
+     </para>
+    </listitem>
+   </itemizedlist>
+  </para>
  </refsect1>
 
  <refsect1>
-- 
2.39.3

