Re: Operator "=" not unicode-safe?
От | Tom Lane |
---|---|
Тема | Re: Operator "=" not unicode-safe? |
Дата | |
Msg-id | 26649.1124476820@sss.pgh.pa.us обсуждение исходный текст |
Ответ на | Operator "=" not unicode-safe? (Jörg Haustein <Joerg.Haustein@urz.uni-heidelberg.de>) |
Список | pgsql-bugs |
Jörg Haustein <Joerg.Haustein@urz.uni-heidelberg.de> writes: > I have a UNICODE database, trying to compare two unicode strings (Ethiopic > characters). Client encoding is also UNICODE: > =================================================== > testdb=> select 'በድሩ ሁሴን'='ሰይፉ ከበደ'; > ?column? > ---------- > t > (1 row) > Clearly, it can be seen that they are not equal. Sounds to me like you chose a locale that is expecting some non-Unicode encoding. "=" ultimately depends on the system's strcoll() routine, and in many locales strcoll doesn't behave very sanely when handed data that's illegal in whatever it thinks the encoding is. Redo your initdb in a locale that is UTF-8 based, and make sure to keep the database encoding UTF8. The apparent flexibility to choose different database encodings really only works if the underlying locale is "C". There is a warning about this in the docs, though perhaps not prominent enough: http://www.postgresql.org/docs/8.0/static/multibyte.html#AEN20633 regards, tom lane
В списке pgsql-bugs по дате отправления: