Re: equal operator fails on two identical strings if initdb

Поиск
Список
Период
Сортировка
От Kent Tong
Тема Re: equal operator fails on two identical strings if initdb
Дата
Msg-id 41A55520.2070400@cpttm.org.mo
обсуждение исходный текст
Ответ на Re: equal operator fails on two identical strings if initdb  (Peter Eisentraut <peter_e@gmx.net>)
Ответы Re: equal operator fails on two identical strings if initdb  (Tom Lane <tgl@sss.pgh.pa.us>)
Список 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 по дате отправления:

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: Stack not being popped correctly (was: Re: [HACKERS] plpgsql lacks generic identifier for record in triggers...)
Следующее
От: Tom Lane
Дата:
Сообщение: Re: equal operator fails on two identical strings if initdb