Different result when using '=' and 'like' in unicode mode

From: Jiang Sheng <jiangsheng(at)sis(dot)sh(dot)cn>
To: pgsql-bugs(at)postgresql(dot)org
Subject: Different result when using '=' and 'like' in unicode mode
Date: 2002-11-17 06:18:35
Message-ID: 000f01c28e01$294e3d20$234aa8c0@jiangsheng
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message Peter Eisentraut 2002-11-17 21:21:09 Re: Different result when using '=' and 'like' in unicode
Previous Message pgsql-bugs 2002-11-17 04:13:43 Bug #819: