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

Commitf6e9cbf

Browse files
committed
Report more information if pg_perm_setlocale() fails at startup.
We don't know why a few Windows users have seen this fail, but thetaciturnity of the error message certainly isn't helping debug it.Let's at least find out which LC category isn't working.
1 parent21187cf commitf6e9cbf

File tree

1 file changed

+14
-13
lines changed

1 file changed

+14
-13
lines changed

‎src/backend/main/main.c

Lines changed: 14 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ const char *progname;
4343

4444

4545
staticvoidstartup_hacks(constchar*progname);
46-
staticvoidinit_locale(intcategory,constchar*locale);
46+
staticvoidinit_locale(constchar*categoryname,intcategory,constchar*locale);
4747
staticvoidhelp(constchar*progname);
4848
staticvoidcheck_root(constchar*progname);
4949

@@ -116,31 +116,31 @@ main(int argc, char *argv[])
116116
char*env_locale;
117117

118118
if ((env_locale=getenv("LC_COLLATE"))!=NULL)
119-
init_locale(LC_COLLATE,env_locale);
119+
init_locale("LC_COLLATE",LC_COLLATE,env_locale);
120120
else
121-
init_locale(LC_COLLATE,"");
121+
init_locale("LC_COLLATE",LC_COLLATE,"");
122122

123123
if ((env_locale=getenv("LC_CTYPE"))!=NULL)
124-
init_locale(LC_CTYPE,env_locale);
124+
init_locale("LC_CTYPE",LC_CTYPE,env_locale);
125125
else
126-
init_locale(LC_CTYPE,"");
126+
init_locale("LC_CTYPE",LC_CTYPE,"");
127127
}
128128
#else
129-
init_locale(LC_COLLATE,"");
130-
init_locale(LC_CTYPE,"");
129+
init_locale("LC_COLLATE",LC_COLLATE,"");
130+
init_locale("LC_CTYPE",LC_CTYPE,"");
131131
#endif
132132

133133
#ifdefLC_MESSAGES
134-
init_locale(LC_MESSAGES,"");
134+
init_locale("LC_MESSAGES",LC_MESSAGES,"");
135135
#endif
136136

137137
/*
138138
* We keep these set to "C" always, except transiently in pg_locale.c; see
139139
* that file for explanations.
140140
*/
141-
init_locale(LC_MONETARY,"C");
142-
init_locale(LC_NUMERIC,"C");
143-
init_locale(LC_TIME,"C");
141+
init_locale("LC_MONETARY",LC_MONETARY,"C");
142+
init_locale("LC_NUMERIC",LC_NUMERIC,"C");
143+
init_locale("LC_TIME",LC_TIME,"C");
144144

145145
/*
146146
* Now that we have absorbed as much as we wish to from the locale
@@ -280,11 +280,12 @@ startup_hacks(const char *progname)
280280
* category's environment variable.
281281
*/
282282
staticvoid
283-
init_locale(intcategory,constchar*locale)
283+
init_locale(constchar*categoryname,intcategory,constchar*locale)
284284
{
285285
if (pg_perm_setlocale(category,locale)==NULL&&
286286
pg_perm_setlocale(category,"C")==NULL)
287-
elog(FATAL,"could not adopt C locale");
287+
elog(FATAL,"could not adopt \"%s\" locale nor C locale for %s",
288+
locale,categoryname);
288289
}
289290

290291

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp