Commit 11c08c3f authored by Bruce Momjian's avatar Bruce Momjian

In pg_upgrade, do case-insensitive checks of locale, encoding, and ctype

because these are often inconsistently capitalized.
parent 8ff1f6a7
...@@ -333,13 +333,14 @@ static void ...@@ -333,13 +333,14 @@ static void
check_locale_and_encoding(ControlData *oldctrl, check_locale_and_encoding(ControlData *oldctrl,
ControlData *newctrl) ControlData *newctrl)
{ {
if (strcmp(oldctrl->lc_collate, newctrl->lc_collate) != 0) /* These are often defined with inconsistent case, so use pg_strcasecmp(). */
if (pg_strcasecmp(oldctrl->lc_collate, newctrl->lc_collate) != 0)
pg_log(PG_FATAL, pg_log(PG_FATAL,
"old and new cluster lc_collate values do not match\n"); "old and new cluster lc_collate values do not match\n");
if (strcmp(oldctrl->lc_ctype, newctrl->lc_ctype) != 0) if (pg_strcasecmp(oldctrl->lc_ctype, newctrl->lc_ctype) != 0)
pg_log(PG_FATAL, pg_log(PG_FATAL,
"old and new cluster lc_ctype values do not match\n"); "old and new cluster lc_ctype values do not match\n");
if (strcmp(oldctrl->encoding, newctrl->encoding) != 0) if (pg_strcasecmp(oldctrl->encoding, newctrl->encoding) != 0)
pg_log(PG_FATAL, pg_log(PG_FATAL,
"old and new cluster encoding values do not match\n"); "old and new cluster encoding values do not match\n");
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment