Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
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

+8-4
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)