Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Skip to content

Commit 11c08c3

Browse files
committed
In pg_upgrade, do case-insensitive checks of locale, encoding, and ctype
because these are often inconsistently capitalized.
1 parent 8ff1f6a commit 11c08c3

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

contrib/pg_upgrade/check.c

+4-3
Original file line numberDiff line numberDiff line change
@@ -333,13 +333,14 @@ static void
333333
check_locale_and_encoding(ControlData *oldctrl,
334334
ControlData *newctrl)
335335
{
336-
if (strcmp(oldctrl->lc_collate, newctrl->lc_collate) != 0)
336+
/* These are often defined with inconsistent case, so use pg_strcasecmp(). */
337+
if (pg_strcasecmp(oldctrl->lc_collate, newctrl->lc_collate) != 0)
337338
pg_log(PG_FATAL,
338339
"old and new cluster lc_collate values do not match\n");
339-
if (strcmp(oldctrl->lc_ctype, newctrl->lc_ctype) != 0)
340+
if (pg_strcasecmp(oldctrl->lc_ctype, newctrl->lc_ctype) != 0)
340341
pg_log(PG_FATAL,
341342
"old and new cluster lc_ctype values do not match\n");
342-
if (strcmp(oldctrl->encoding, newctrl->encoding) != 0)
343+
if (pg_strcasecmp(oldctrl->encoding, newctrl->encoding) != 0)
343344
pg_log(PG_FATAL,
344345
"old and new cluster encoding values do not match\n");
345346
}

0 commit comments

Comments
 (0)