Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit11c08c3

Browse files
committed
In pg_upgrade, do case-insensitive checks of locale, encoding, and ctype
because these are often inconsistently capitalized.
1 parent8ff1f6a commit11c08c3

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

‎contrib/pg_upgrade/check.c

Lines changed: 4 additions & 3 deletions
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)

[8]ページ先頭

©2009-2025 Movatter.jp