Re: UTF-8 and LIKE vs = - Mailing list pgsql-general

From David Wheeler
Subject Re: UTF-8 and LIKE vs =
Date
Msg-id F820D962-F547-11D8-990D-000A95972D84@kineticode.com
Whole thread Raw
In response to Re: UTF-8 and LIKE vs =  (Ian Barwick <barwick@gmail.com>)
Responses Re: UTF-8 and LIKE vs =
Re: UTF-8 and LIKE vs =
Re: UTF-8 and LIKE vs =
List 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

Attachment

pgsql-general by date:

Previous
From: Ian Barwick
Date:
Subject: Re: UTF-8 and LIKE vs =
Next
From: Carlos Moreno
Date:
Subject: Deadlocks -- what can I do about them?