Skip to content

Commit dc01efa

Browse files
committed
pg_upgrade: improve checksum mismatch error message
Patch by Greg Sabino Mullane, slight adjustments by me
1 parent 056764b commit dc01efa

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

contrib/pg_upgrade/controldata.c

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -572,10 +572,14 @@ check_control_data(ControlData *oldctrl,
572572
* We might eventually allow upgrades from checksum to no-checksum
573573
* clusters.
574574
*/
575-
if (oldctrl->data_checksum_version != newctrl->data_checksum_version)
576-
{
577-
pg_fatal("old and new pg_controldata checksum versions are invalid or do not match\n");
578-
}
575+
if (oldctrl->data_checksum_version == 0 &&
576+
newctrl->data_checksum_version != 0)
577+
pg_fatal("old cluster does not use data checksums but the new one does\n");
578+
else if (oldctrl->data_checksum_version != 0 &&
579+
newctrl->data_checksum_version == 0)
580+
pg_fatal("old cluster uses data checksums but the new one does not\n");
581+
else if (oldctrl->data_checksum_version != newctrl->data_checksum_version)
582+
pg_fatal("old and new cluster pg_controldata checksum versions do not match\n");
579583
}
580584

581585

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy