Re: equal operator fails on two identical strings if initdb

Поиск
Список
Период
Сортировка
От Peter Eisentraut
Тема Re: equal operator fails on two identical strings if initdb
Дата
Msg-id 200411241646.57709.peter_e@gmx.net
обсуждение исходный текст
Ответ на Re: equal operator fails on two identical strings if initdb  (Kent Tong <kent@cpttm.org.mo>)
Ответы Re: equal operator fails on two identical strings if initdb  (Kent Tong <kent@cpttm.org.mo>)
Список pgsql-bugs
Kent Tong wrote:
> Is there any way to check?

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.

> I have other programs reading and writing Unicode on this
> computer without problems.

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.

> Are you using the locale routines in mingw?

I believe we do.

--
Peter Eisentraut
http://developer.postgresql.org/~petere/

В списке pgsql-bugs по дате отправления:

Предыдущее
От: "PostgreSQL Bugs List"
Дата:
Сообщение: BUG #1328: psql don't accept some valid PGCLIENTENCODING values
Следующее
От: Tom Lane
Дата:
Сообщение: Re: BUG #1328: psql don't accept some valid PGCLIENTENCODING values