From 5f7a56f65efe8c94ed64e1dbd07a464d2c920c9b Mon Sep 17 00:00:00 2001
From: Sai Pranav <rajasaipranav0@gmail.com>
Date: Tue, 3 Nov 2026 19:15:16 +0530
Subject: [PATCH v1] pg_combinebackup: Don't point only to pg_checksums for
 mixed checksum states

When pg_combinebackup refuses a backup chain whose backups were taken
under different data checksum states, its hint and the Limitations
section of its documentation tell the user to take a new full backup
after enabling checksums with pg_checksums.  Since checksums can also be
enabled online with pg_enable_data_checksums(), the same refusal happens
when they were enabled that way, or when an earlier backup was taken
while they were still being enabled, and the hint then names a tool the
user never ran.

Drop the reference to pg_checksums from the hint, and describe both
ways of enabling checksums in the documentation, along with the case of
a backup taken while checksums were being enabled.
---
 doc/src/sgml/ref/pg_combinebackup.sgml      | 14 ++++++++------
 src/bin/pg_combinebackup/pg_combinebackup.c |  2 +-
 2 files changed, 9 insertions(+), 7 deletions(-)

diff --git a/doc/src/sgml/ref/pg_combinebackup.sgml b/doc/src/sgml/ref/pg_combinebackup.sgml
index f5d7e177b36..c300a617cd6 100644
--- a/doc/src/sgml/ref/pg_combinebackup.sgml
+++ b/doc/src/sgml/ref/pg_combinebackup.sgml
@@ -306,13 +306,15 @@ PostgreSQL documentation
 
   <para>
    <literal>pg_combinebackup</literal> does not recompute page checksums when
-   writing the output directory.  It therefore refuses a chain in which some
-   of the backups used for reconstruction were taken with checksums disabled
-   but the final backup was taken with checksums enabled: the resulting
-   directory would contain pages with invalid checksums, and the cluster
+   writing the output directory.  It therefore refuses a chain in which the
+   final backup was taken with checksums enabled but some of the backups used
+   for reconstruction were not, because they were taken before checksums
+   were enabled or while they were still being enabled: the resulting
+   directory could contain pages with invalid checksums, and the cluster
    would fail checksum verification as soon as it reads them.  Take a new
-   full backup after enabling data checksums with
-   <xref linkend="app-pgchecksums"/>.
+   full backup once data checksums have been enabled, whether offline with
+   <xref linkend="app-pgchecksums"/> or online (see
+   <xref linkend="checksums-online-enable-disable"/>).
   </para>
 
   <para>
diff --git a/src/bin/pg_combinebackup/pg_combinebackup.c b/src/bin/pg_combinebackup/pg_combinebackup.c
index 254a27b125b..589b5c8e795 100644
--- a/src/bin/pg_combinebackup/pg_combinebackup.c
+++ b/src/bin/pg_combinebackup/pg_combinebackup.c
@@ -681,7 +681,7 @@ check_control_files(int n_backups, char **backup_dirs)
 	if (data_checksum_mismatch)
 	{
 		pg_log_error("only some backups have checksums enabled");
-		pg_log_error_hint("Take a new full backup after changing the data checksum state with pg_checksums.");
+		pg_log_error_hint("Take a new full backup after changing the data checksum state.");
 		exit(1);
 	}
 
-- 
2.50.1 (Apple Git-155)

