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

Commit9f12a3b

Browse files
committed
Tolerate version lookup failure for old style Windows locale names.
Accept that we can't get versions for such locale names for now. Userswill need to specify the newer language tag format to enable thecollation versioning feature. It's not clear that we can do automaticconversion from the old style to the new style reliably enough for thispurpose.Unfortunately, this means that collation versioning probably won't workfor the default collation unless you provide something like en-US atinitdb or CREATE DATABASE time (though, for reasons not yet understood,it does seem to work on some systems). It'd be nice to find a bettersolution, or document this quirk if we settle on it, but this shouldunbreak the 3 failing build farm animals in the meantime.Reviewed-by: David Rowley <dgrowleyml@gmail.com>Reviewed-by: Tom Lane <tgl@sss.pgh.pa.us>Discussion:https://postgr.es/m/CAEepm%3D0uEQCpfq_%2BLYFBdArCe4Ot98t1aR4eYiYTe%3DyavQygiQ%40mail.gmail.com
1 parente152506 commit9f12a3b

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

‎src/backend/utils/adt/pg_locale.c

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1702,10 +1702,22 @@ get_collation_actual_version(char collprovider, const char *collcollate)
17021702
MultiByteToWideChar(CP_ACP,0,collcollate,-1,wide_collcollate,
17031703
LOCALE_NAME_MAX_LENGTH);
17041704
if (!GetNLSVersionEx(COMPARE_STRING,wide_collcollate,&version))
1705+
{
1706+
/*
1707+
* GetNLSVersionEx() wants a language tag such as "en-US", not a
1708+
* locale name like "English_United States.1252". Until those
1709+
* values can be prevented from entering the system, or 100%
1710+
* reliably converted to the more useful tag format, tolerate the
1711+
* resulting error and report that we have no version data.
1712+
*/
1713+
if (GetLastError()==ERROR_INVALID_PARAMETER)
1714+
returnNULL;
1715+
17051716
ereport(ERROR,
17061717
(errmsg("could not get collation version for locale \"%s\": error code %lu",
17071718
collcollate,
17081719
GetLastError())));
1720+
}
17091721
collversion=psprintf("%d.%d,%d.%d",
17101722
(version.dwNLSVersion >>8)&0xFFFF,
17111723
version.dwNLSVersion&0xFF,

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp