summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--contrib/pg_upgrade/controldata.c12
1 files changed, 8 insertions, 4 deletions
diff --git a/contrib/pg_upgrade/controldata.c b/contrib/pg_upgrade/controldata.c
index a02a8ecaa23..0e70b6f80b4 100644
--- a/contrib/pg_upgrade/controldata.c
+++ b/contrib/pg_upgrade/controldata.c
@@ -572,10 +572,14 @@ check_control_data(ControlData *oldctrl,
* We might eventually allow upgrades from checksum to no-checksum
* clusters.
*/
- if (oldctrl->data_checksum_version != newctrl->data_checksum_version)
- {
- pg_fatal("old and new pg_controldata checksum versions are invalid or do not match\n");
- }
+ if (oldctrl->data_checksum_version == 0 &&
+ newctrl->data_checksum_version != 0)
+ pg_fatal("old cluster does not use data checksums but the new one does\n");
+ else if (oldctrl->data_checksum_version != 0 &&
+ newctrl->data_checksum_version == 0)
+ pg_fatal("old cluster uses data checksums but the new one does not\n");
+ else if (oldctrl->data_checksum_version != newctrl->data_checksum_version)
+ pg_fatal("old and new cluster pg_controldata checksum versions do not match\n");
}