Re: Problems with a custom LOCALE - Mailing list pgsql-general

From James B. Byrne
Subject Re: Problems with a custom LOCALE
Date
Msg-id 953b67517dc1fc34833a8449d93051cf.squirrel@webmail.harte-lyne.ca
Whole thread Raw
In response to Re: Problems with a custom LOCALE  (Tom Lane <tgl@sss.pgh.pa.us>)
Responses Re: Problems with a custom LOCALE
List pgsql-general
On Fri, December 14, 2012 17:40, Tom Lane wrote:
> "James B. Byrne" <byrnejb@harte-lyne.ca> writes:
>> PG::Error: ERROR:  encoding "UTF8" does not match locale
>> "en_CA@yyyy-mmm-dd.UTF-8"
>> DETAIL:  The chosen LC_CTYPE setting requires encoding "LATIN1".
>> : CREATE DATABASE "hll_th_forex_test" ENCODING = 'UTF8' TEMPLATE =
>> "template1"
>
>
> Sorta looks like you based that locale on an ISO 8859-1 locale, not a
> UTF8 locale.  AFAICT from looking at the code, PG is seeing that
> nl_langinfo(CODESET) returns "ISO-8859-1" or some variant spelling,
> so it complains.
>

This is what I see on the host running postgresql-9.2

# LC_ALL=en_CA@yyyy-mmm-dd.utf8 locale charmap
UTF-8
#

However, on that system, because of PostgreSQL, we have left the
locale unmodified from default provided in CentOS-5.8:
# locale
LANG=en_US.UTF-8
LC_CTYPE="en_US.UTF-8"
LC_NUMERIC="en_US.UTF-8"
LC_TIME="en_US.UTF-8"
LC_COLLATE="en_US.UTF-8"
LC_MONETARY="en_US.UTF-8"
LC_MESSAGES="en_US.UTF-8"
LC_PAPER="en_US.UTF-8"
LC_NAME="en_US.UTF-8"
LC_ADDRESS="en_US.UTF-8"
LC_TELEPHONE="en_US.UTF-8"
LC_MEASUREMENT="en_US.UTF-8"
LC_IDENTIFICATION="en_US.UTF-8"
LC_ALL=
# locale charmap
UTF-8

Running locale against the base en_CA@yyyy-mmm-dd on the PG host shows
this.

LC_ALL=en_CA@yyyy-mmm-dd locale charmap
ISO-8859-1

On the calling system I see this:

$ locale
LANG=en_CA.UTF-8
LC_CTYPE="en_CA.UTF-8"
LC_NUMERIC="en_CA.UTF-8"
LC_TIME="en_CA.UTF-8"
LC_COLLATE="en_CA.UTF-8"
LC_MONETARY="en_CA.UTF-8"
LC_MESSAGES="en_CA.UTF-8"
LC_PAPER="en_CA.UTF-8"
LC_NAME="en_CA.UTF-8"
LC_ADDRESS="en_CA.UTF-8"
LC_TELEPHONE="en_CA.UTF-8"
LC_MEASUREMENT="en_CA.UTF-8"
LC_IDENTIFICATION="en_CA.UTF-8"
LC_ALL=
$ locale charmap
UTF-8

Previously we were running PG 8.4 on that host and did not encounter
this problem.

--
***          E-Mail is NOT a SECURE channel          ***
James B. Byrne                mailto:ByrneJB@Harte-Lyne.ca
Harte & Lyne Limited          http://www.harte-lyne.ca
9 Brockley Drive              vox: +1 905 561 1241
Hamilton, Ontario             fax: +1 905 561 0757
Canada  L8E 3C3



pgsql-general by date:

Previous
From: Tom Lane
Date:
Subject: Re: PG 8.4 to 9.2 upgrade issues with ownership of large objects
Next
From: Tom Lane
Date:
Subject: Re: Problems with a custom LOCALE