Content-Length: 274914 | pFad | http://github.com/postgrespro/postgres/commit/dc01efa5ccdd9804b0c97d4d9b651ba9360ebb11

6F pg_upgrade: improve checksum mismatch error message · postgrespro/postgres@dc01efa · GitHub
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)








ApplySandwichStrip

pFad - (p)hone/(F)rame/(a)nonymizer/(d)eclutterfier!      Saves Data!


--- a PPN by Garber Painting Akron. With Image Size Reduction included!

Fetched URL: http://github.com/postgrespro/postgres/commit/dc01efa5ccdd9804b0c97d4d9b651ba9360ebb11

Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy