Re: Re: BUG #11431: Failing to backup and restore a Windows postgres database, with Norwegian Bokmål locale. - Mailing list pgsql-bugs

From Noah Misch
Subject Re: Re: BUG #11431: Failing to backup and restore a Windows postgres database, with Norwegian Bokmål locale.
Date
Msg-id 20140921180413.GA1585212@tornado.leadboat.com
Whole thread Raw
In response to Re: Re: BUG #11431: Failing to backup and restore a Windows postgres database, with Norwegian Bokmål locale.  (Tom Lane <tgl@sss.pgh.pa.us>)
Responses Re: [BUGS] Re: BUG #11431: Failing to backup and restore a Windows postgres database, with Norwegian Bokmål locale.
List pgsql-bugs
On Sun, Sep 21, 2014 at 12:13:25PM -0400, Tom Lane wrote:
> Noah Misch <noah@leadboat.com> writes:
> > On Fri, Sep 19, 2014 at 03:15:53PM -0700, Alon wrote:
> >> The pg_dump file contains this command:
> >> CREATE DATABASE workgroup WITH TEMPLATE = template0 ENCODING = 'UTF8'
> >> LC_COLLATE = 'Norwegian (Bokmål)_Norway.1252' LC_CTYPE = 'Norwegian
> >> (Bokmål)_Norway.1252';
>
> > In WIN1252, "e5 6c 29" is "ål)".  We're likely failing to set client_encoding
> > at some essential point in the process.
>
> The level of stupidity needed to use non-ASCII characters in a locale name
> is breathtaking.  What were Microsoft thinking?

Windows Vista did deprecate that locale name style in favor of "nb-NO".
setlocale(LC_x, "") still returns the old style, though.  You need PostgreSQL
built with VS2012 or later to use "nb-NO" style; see IsoLocaleName().

> How are we supposed to
> guess what encoding applies when setting the encoding?

Windows functions with "char *" arguments where encoding matters typically
expect the argument to be in the Windows ANSI code page.



pgsql-bugs by date:

Previous
From: Tom Lane
Date:
Subject: Re: Re: BUG #11431: Failing to backup and restore a Windows postgres database, with Norwegian Bokmål locale.
Next
From: Alon
Date:
Subject: Re: Re: BUG #11431: Failing to backup and restore a Windows postgres database, with Norwegian Bokmål locale.