Re: UTF-8 and LIKE vs =

Поиск
Список
Период
Сортировка
От David Wheeler
Тема Re: UTF-8 and LIKE vs =
Дата
Msg-id F820D962-F547-11D8-990D-000A95972D84@kineticode.com
обсуждение исходный текст
Ответ на Re: UTF-8 and LIKE vs =  (Ian Barwick <barwick@gmail.com>)
Ответы Re: UTF-8 and LIKE vs =  (Ian Barwick <barwick@gmail.com>)
Re: UTF-8 and LIKE vs =  (Tom Lane <tgl@sss.pgh.pa.us>)
Re: UTF-8 and LIKE vs =  (Markus Bertheau <twanger@bluetwanger.de>)
Список pgsql-general
On Aug 23, 2004, at 1:58 PM, Ian Barwick wrote:

> er, the characters in "name" don't seem to match the characters in the
> query - '국방비' vs. '북한의' - does that have any bearing?

Yes, it means that = is doing the wrong thing!!

I noticed this because I had a query that was looking in the keyword
table for an existing record using LIKE. If it didn't find it, it
inserted it. But the inserts were giving me an error because the name
column has a UNIQUE index on it. Could it be that the index and the =
operator are comparing bytes, and that '국방비' and '북한의' have the same
bytes but different characters??

If so, this is a pretty serious problem. How can I get = and the
indices to use character semantics rather than byte semantics? I also
need to be able to store data in different languages in the database
(and in the same column!), but all in Unicode.

TIA,

David

Вложения

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

Предыдущее
От: Ian Barwick
Дата:
Сообщение: Re: UTF-8 and LIKE vs =
Следующее
От: Carlos Moreno
Дата:
Сообщение: Deadlocks -- what can I do about them?