Re: "could not adopt C locale" failure at startup on Windows - Mailing list pgsql-hackers

From Tom Lane
Subject Re: "could not adopt C locale" failure at startup on Windows
Date
Msg-id 3490.1433945378@sss.pgh.pa.us
Whole thread Raw
In response to Re: "could not adopt C locale" failure at startup on Windows  (Noah Misch <noah@leadboat.com>)
Responses Re: "could not adopt C locale" failure at startup on Windows  (Noah Misch <noah@leadboat.com>)
List pgsql-hackers
Noah Misch <noah@leadboat.com> writes:
> On Tue, Jun 09, 2015 at 12:24:02PM -0400, Tom Lane wrote:
>> Yeah, my first instinct was to blame ca325941 as well, but I don't think
>> any of that code executes during init_locale().  Also,
>> http://www.postgresql.org/message-id/20150326040321.2492.24716@wrigleys.postgresql.org
>> says it's been seen in 9.4.1.

> The return value check and error message were new in 9.4.1.  I suspect the
> underlying problem has been present far longer, undetected.

Oooh ... I'd forgotten that 6fdba8ceb was so recent.  Agreed, what we are
seeing is probably a situation that's been there for a long time, but we
were ignoring the failure up to now (and, evidently, it wasn't really
creating any problems).

> I can reproduce this with "initdb --locale=C",
> postgresql-9.4.3-1-windows-binaries.zip (32-bit), Windows 7 x64, and the
> Windows ANSI code page set to CP936.  (Choose "Chinese (Simplified, PRC)" in
> Control Panel -> Region and Language -> Administrative -> Language for
> non-Unicode programs.)  It is neither necessary nor sufficient to change
> Control Panel -> Region and Language -> Formats -> Format.  Binaries from
> postgresql-9.4.3-1-windows-x64-binaries.zip do not exhibit the problem.  Note
> that CP936 is a PG_ENCODING_IS_CLIENT_ONLY() encoding.

Hm.  I could understand getting encoding difficulties in that environment,
but it's hard to see why they'd manifest like this.  Can you trace through
pg_perm_setlocale and figure out why it's reporting failure?
        regards, tom lane



pgsql-hackers by date:

Previous
From: Nils Goroll
Date:
Subject: Re: s_lock() seems too aggressive for machines with many sockets
Next
From: Nils Goroll
Date:
Subject: Re: s_lock() seems too aggressive for machines with many sockets