Re: equal operator fails on two identical strings if initdb

From: Kent Tong <kent(at)cpttm(dot)org(dot)mo>
To: pgsql-bugs(at)postgresql(dot)org
Subject: Re: equal operator fails on two identical strings if initdb
Date: 2004-11-25 03:44:32
Message-ID: 41A55520.2070400@cpttm.org.mo
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

Peter Eisentraut wrote:
> On a POSIX system, you can do
>
> $ LC_ALL=<some_locale> locale charmap
>
> and verify manually that the printed charmap (= character set encoding)
> matches what you use in PostgreSQL. I don't know whether an equivalent
> interface exists on Windows.

Right, there is no such command.

> Reading and writing Unicode is not a problem. But if you run the string
> comparison operators, PostgreSQL passes the Unicode strings from your
> database to the operating system's collation routines, which will
> compare them thinking they are Big5 (or whatever) strings, which will
> result in the random behavior you observed. You need to set an
> appropriate locale so that the operating system also thinks they are in
> Unicode.

You mean the OS fails to convert unicode strings to Big5 or the
OS assumes the bytes are already in Big5?

It is the locale used for initdb or the default system locale
set in Windows that is used by the collation routines that you
mentioned above?

I just double checked my config and found that the default locale
is US english. The "supported languages" are:
* Traditional Chinese (default)
* Simplified Chinese
* Western Europe and United States.

In response to

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message Tom Lane 2004-11-25 03:52:56 Re: equal operator fails on two identical strings if initdb
Previous Message Tom Lane 2004-11-25 03:36:35 Re: Stack not being popped correctly (was: Re: [HACKERS] plpgsql lacks generic identifier for record in triggers...)