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

Поиск
Список
Период
Сортировка
От Jiang Sheng
Тема Different result when using '=' and 'like' in unicode mode
Дата
Msg-id 000f01c28e01$294e3d20$234aa8c0@jiangsheng
обсуждение исходный текст
Ответы Re: Different result when using '=' and 'like' in unicode  (Peter Eisentraut <peter_e@gmx.net>)
Список 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 по дате отправления:

Предыдущее
От: pgsql-bugs@postgresql.org
Дата:
Сообщение: Bug #819:
Следующее
От: Peter Eisentraut
Дата:
Сообщение: Re: Different result when using '=' and 'like' in unicode