Search Postgresql Archives

Re: Problems with a custom LOCALE

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Fri, December 14, 2012 17:40, Tom Lane wrote:
> "James B. Byrne" <byrnejb@xxxxxxxxxxxxx> writes:
>> PG::Error: ERROR:  encoding "UTF8" does not match locale
>> "en_CA@xxxxxxxxxxxxxxx-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@xxxxxxxxxxxxx
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



-- 
Sent via pgsql-general mailing list (pgsql-general@xxxxxxxxxxxxxx)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general



[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux