git.postgresql.org Git - postgresql.git/commitdiff

git projects / postgresql.git / commitdiff
? search:
summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 056764b)
pg_upgrade: improve checksum mismatch error message
2015年2月12日 03:22:26 +0000 (22:22 -0500)
2015年2月12日 03:22:26 +0000 (22:22 -0500)
Patch by Greg Sabino Mullane, slight adjustments by me


diff --git a/contrib/pg_upgrade/controldata.c b/contrib/pg_upgrade/controldata.c
index a02a8ecaa2391ac31a76eb2bc478ea149ff98cb8..0e70b6f80b484e4e4535c025d3e997f76d4bfd4e 100644 (file)
--- 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");
}
This is the main PostgreSQL git repository.
RSS Atom

AltStyle によって変換されたページ (->オリジナル) /