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