locale support

From: Tatsuo Ishii <t-ishii(at)sra(dot)co(dot)jp>
To: pgsql-hackers(at)postgresql(dot)org
Subject: locale support
Date: 2001-02-13 02:53:11
Message-ID: 20010213115311S.t-ishii@sra.co.jp
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

There is a serious problem with the PostgreSQL locale support on
certain platforms and certain locale combo. That is: simply ordering,
indexes etc. are broken because strcoll() does not work. Example
combo includes: RedHat 6.2J(Japanese localized version) + ja_JP.eucJP
locale. Here is a test program that expose the problem.

#include <string.h>
#include <locale.h>
main()
{
static char *s1 = "a Japanese string";
static char *s2 = "another Japanese string";

setlocale(LC_ALL,"");

printf("%d\n",strcoll(s1,s2));
printf("%d\n",strcoll(s2,s1));
}

This program prints 0s, that means strcoll() regards that those differnt
Japanese strings are same!

I know this is not PostgreSQL's fault but the broken locale data on
certain platforms. The problem makes it impossible to use PostgreSQL
RPMs in Japan.

I'm looking for solutions/workarounds for this problem. Maybe we
should disable locale support at runntime if strcoll() does not work?
Comments?
--
Tatsuo Ishii

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2001-02-13 02:59:37 Re: locale support
Previous Message Philip Warner 2001-02-13 01:58:32 Re: New setval() call