Different result when using '=' and 'like' in unicode mode - Mailing list pgsql-bugs

From Jiang Sheng
Subject Different result when using '=' and 'like' in unicode mode
Date
Msg-id 000f01c28e01$294e3d20$234aa8c0@jiangsheng
Whole thread Raw
Responses Re: Different result when using '=' and 'like' in unicode
List pgsql-bugs
I used PostgreSQL 7.2.1 on redhat 7.3, installed using the rpm from redhat,.
When I createdb -E UNICODE, and import data using \copy command, after
converted  all the imported text files to UTF-8 encoding. It looks well, I
can get
the data from several platforms in different locale. But, a strange problem,
when i using '=' in where clause, to match the varchar value, the result is
not correct,
for example, the table structure is

             Table "tbl_test"
   Column    |         Type          | Modifiers
-------------+-----------------------+-----------
 id          | integer               |
 name        | character varying(40) |

the sql is
select * from tbl_test where name = '石田';

but the result contains other data, such as 石町, 柳町, 柳田

and I changed the sql to
select * from tbl_test where name like '石田';
select * from tbl_test where name ilike '石田';

the results both correct.

I don't know the reason of this problem, and in my application it not
allowed
to use 'like' replaced '=', the data amount is too large.

Is this a bug of PostgreSQL? or only a problem in redhat environment? and
how to fix it?

Thx,
Jiang Sheng

pgsql-bugs by date:

Previous
From: pgsql-bugs@postgresql.org
Date:
Subject: Bug #819:
Next
From: Peter Eisentraut
Date:
Subject: Re: Different result when using '=' and 'like' in unicode