Re: Enforcing database encoding and locale match

From: Zdenek Kotala <Zdenek(dot)Kotala(at)Sun(dot)COM>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Alvaro Herrera <alvherre(at)commandprompt(dot)com>, Andrew Dunstan <andrew(at)dunslane(dot)net>, Gregory Stark <stark(at)enterprisedb(dot)com>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: Enforcing database encoding and locale match
Date: 2007-10-05 20:10:45
Message-ID: 47069A45.2060307@sun.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Tom Lane wrote:
> Alvaro Herrera <alvherre(at)commandprompt(dot)com> writes:
>> FWIW I tried this program here, and I get
>
>> C ... ANSI_X3.4-1968 - NO MATCH
>> POSIX ... ANSI_X3.4-1968 - NO MATCH
>
>> Note the funny name. Trying initdb with LC_ALL=C correctly uses
>> SQL_ASCII (I saw the special case in chklocale.c), but I'm wondering if
>> we should list those names explicitely.
>
> Since we're already special-casing C/POSIX, I don't see a need.
> It looks a bit hopeless to keep up with all the possibilities anyway
> --- by my count we've tested four different platforms so far and
> gotten four different answers for the CODESET name for C :-(
>
> Linux ANSI_X3.4-1968
> Darwin (empty)
> Solaris 646
> HP-UX roman8

There is some useful link:

http://www.simeji.com/bun/characterencoding_jvm142.txt

with aliases. I also checked all possible locales on Solaris nevada and
there are two new aliases and probably unsupported TIS620.2533 (thai)
encoding by postgres.

Patch with new aliases attached.

Zdenek

===================================================================
RCS file: /zfs_data/cvs_pgsql/cvsroot/pgsql/src/port/chklocale.c,v
retrieving revision 1.4
diff -c -r1.4 chklocale.c
*** src/port/chklocale.c 2007/10/03 17:16:39 1.4
--- src/port/chklocale.c 2007/10/05 17:55:10
***************
*** 127,132 ****
--- 127,133 ----
{PG_WIN874, "???"},
#endif
{PG_WIN1251, "CP1251"},
+ {PG_WIN1251, "ansi-1251"},
{PG_WIN866, "CP866"},

{PG_ISO_8859_5, "ISO-8859-5"},
***************
*** 152,157 ****
--- 153,159 ----
{PG_BIG5, "BIG5"},
{PG_BIG5, "BIG5HKSCS"},
{PG_BIG5, "CP950"},
+ {PG_BIG5, "Big5-HKSCS"},

{PG_GBK, "GBK"},
{PG_GBK, "CP936"},

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Gregory Stark 2007-10-05 22:18:21 Encoding and i18n
Previous Message Simon Riggs 2007-10-05 19:43:18 Re: Polymorphic arguments and composite types