Re: equal operator fails on two identical strings if initdb - Mailing list pgsql-bugs

From Kent Tong
Subject Re: equal operator fails on two identical strings if initdb
Date
Msg-id 41A55520.2070400@cpttm.org.mo
Whole thread Raw
In response to Re: equal operator fails on two identical strings if initdb  (Peter Eisentraut <peter_e@gmx.net>)
Responses Re: equal operator fails on two identical strings if initdb
List 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.

pgsql-bugs by date:

Previous
From: Tom Lane
Date:
Subject: Re: Stack not being popped correctly (was: Re: [HACKERS] plpgsql lacks generic identifier for record in triggers...)
Next
From: Tom Lane
Date:
Subject: Re: equal operator fails on two identical strings if initdb