Re: Problems with a custom LOCALE

From: "James B(dot) Byrne" <byrnejb(at)harte-lyne(dot)ca>
To: "Tom Lane" <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: Problems with a custom LOCALE
Date: 2012-12-16 19:26:28
Message-ID: 953b67517dc1fc34833a8449d93051cf.squirrel@webmail.harte-lyne.ca
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general


On Fri, December 14, 2012 17:40, Tom Lane wrote:
> "James B. Byrne" <byrnejb(at)harte-lyne(dot)ca> writes:
>> PG::Error: ERROR: encoding "UTF8" does not match locale
>> "en_CA(at)yyyy-mmm-dd(dot)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(at)yyyy-mmm-dd(dot)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(at)yyyy-mmm-dd on the PG host shows
this.

LC_ALL=en_CA(at)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(at)Harte-Lyne(dot)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

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Tom Lane 2012-12-16 20:13:59 Re: Problems with a custom LOCALE
Previous Message Tom Lane 2012-12-16 19:22:35 Re: PG 8.4 to 9.2 upgrade issues with ownership of large objects