mirror of
https://github.com/postgres/postgres.git
synced 2025-08-19 23:22:23 +03:00
Arrange to set the LC_XXX environment variables to match our locale setup.
Back-patch of previous fix in HEAD for plperl-vs-locale issue.
This commit is contained in:
@@ -7,7 +7,7 @@
|
||||
* Portions Copyright (c) 1996-2005, PostgreSQL Global Development Group
|
||||
* Portions Copyright (c) 1994, Regents of the University of California
|
||||
*
|
||||
* $PostgreSQL: pgsql/src/backend/access/transam/xlog.c,v 1.180.4.3 2005/05/31 19:10:39 tgl Exp $
|
||||
* $PostgreSQL: pgsql/src/backend/access/transam/xlog.c,v 1.180.4.4 2006/01/05 00:55:06 tgl Exp $
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
@@ -41,6 +41,7 @@
|
||||
#include "storage/spin.h"
|
||||
#include "utils/builtins.h"
|
||||
#include "utils/guc.h"
|
||||
#include "utils/pg_locale.h"
|
||||
#include "utils/relcache.h"
|
||||
|
||||
|
||||
@@ -3347,14 +3348,14 @@ ReadControlFile(void)
|
||||
" but the server was compiled with LOCALE_NAME_BUFLEN %d.",
|
||||
ControlFile->localeBuflen, LOCALE_NAME_BUFLEN),
|
||||
errhint("It looks like you need to recompile or initdb.")));
|
||||
if (setlocale(LC_COLLATE, ControlFile->lc_collate) == NULL)
|
||||
if (pg_perm_setlocale(LC_COLLATE, ControlFile->lc_collate) == NULL)
|
||||
ereport(FATAL,
|
||||
(errmsg("database files are incompatible with operating system"),
|
||||
errdetail("The database cluster was initialized with LC_COLLATE \"%s\","
|
||||
" which is not recognized by setlocale().",
|
||||
ControlFile->lc_collate),
|
||||
errhint("It looks like you need to initdb or install locale support.")));
|
||||
if (setlocale(LC_CTYPE, ControlFile->lc_ctype) == NULL)
|
||||
if (pg_perm_setlocale(LC_CTYPE, ControlFile->lc_ctype) == NULL)
|
||||
ereport(FATAL,
|
||||
(errmsg("database files are incompatible with operating system"),
|
||||
errdetail("The database cluster was initialized with LC_CTYPE \"%s\","
|
||||
|
Reference in New Issue
Block a user