|
8 | 8 | *
|
9 | 9 | *
|
10 | 10 | * IDENTIFICATION
|
11 |
| - * $PostgreSQL: pgsql/src/backend/utils/init/postinit.c,v 1.191 2009/06/11 14:49:05 momjian Exp $ |
| 11 | + * $PostgreSQL: pgsql/src/backend/utils/init/postinit.c,v 1.192 2009/07/08 17:53:29 heikki Exp $ |
12 | 12 | *
|
13 | 13 | *
|
14 | 14 | *-------------------------------------------------------------------------
|
|
44 | 44 | #include "utils/acl.h"
|
45 | 45 | #include "utils/flatfiles.h"
|
46 | 46 | #include "utils/guc.h"
|
| 47 | +#include "utils/pg_locale.h" |
47 | 48 | #include "utils/plancache.h"
|
48 | 49 | #include "utils/portal.h"
|
49 | 50 | #include "utils/relcache.h"
|
@@ -247,14 +248,14 @@ CheckMyDatabase(const char *name, bool am_superuser)
|
247 | 248 | collate = NameStr(dbform->datcollate);
|
248 | 249 | ctype = NameStr(dbform->datctype);
|
249 | 250 |
|
250 |
| - if (setlocale(LC_COLLATE, collate) == NULL) |
| 251 | + if (pg_perm_setlocale(LC_COLLATE, collate) == NULL) |
251 | 252 | ereport(FATAL,
|
252 | 253 | (errmsg("database locale is incompatible with operating system"),
|
253 | 254 | errdetail("The database was initialized with LC_COLLATE \"%s\", "
|
254 | 255 | " which is not recognized by setlocale().", collate),
|
255 | 256 | errhint("Recreate the database with another locale or install the missing locale.")));
|
256 | 257 |
|
257 |
| - if (setlocale(LC_CTYPE, ctype) == NULL) |
| 258 | + if (pg_perm_setlocale(LC_CTYPE, ctype) == NULL) |
258 | 259 | ereport(FATAL,
|
259 | 260 | (errmsg("database locale is incompatible with operating system"),
|
260 | 261 | errdetail("The database was initialized with LC_CTYPE \"%s\", "
|
|
0 commit comments