Skip site navigation (1) Skip section navigation (2)

Re: 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: Re: Different result when using '=' and 'like' in unicode mode
Date: 2002-11-18 01:48:27
Message-ID: 002001c28ea4$97259ac0$234aa8c0@jiangsheng (view raw or flat)
Thread:
Lists: pgsql-bugs
Thanks a lot!
In your opinion, should I re-compile the PostgreSQL after set the $LANG
to ja_JP.utf8? or I need to set other variables' value..
I changed the $LANG value, but the result still not correct, and not found
anything about it in PostgrSQL's document.

Thx
Jiang Sheng


----- Original Message -----
送信者 : "Peter Eisentraut" <peter_e(at)gmx(dot)net>
宛先 : "Jiang Sheng" <jiangsheng(at)sis(dot)sh(dot)cn>
Cc: <pgsql-bugs(at)postgresql(dot)org>
送信日時 : 2002年11月18日 6:21
件名 : Re: [BUGS] Different result when using '=' and 'like' in unicode mode


> Jiang Sheng writes:
>
> > 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.
>
> The LIKE operator uses a character-by-character comparison (which could
> quite possibly behave oddly if your strings contain combining characters,
> but that is a different issue).  The = operator uses the host operating
> system's locale facilities to do a locale-aware comparison.  So in general
> LIKE and = are not interchangeable.
>
> If the result you get for = is wrong even under some locale, then you
> probably don't have the right locale set on your server.  Recent glibc
> systems require you to set your locale to xx_YY.utf8 (rather than just
> xx_YY) if you want to use Unicode.
>
> --
> Peter Eisentraut   peter_e(at)gmx(dot)net
>


In response to

Responses

pgsql-bugs by date

Next:From: Brian HarrisDate: 2002-11-18 12:20:58
Subject: Re: PostgreSQL No Longer Handles Mixed Case Sequences
Previous:From: Peter EisentrautDate: 2002-11-17 21:21:09
Subject: Re: Different result when using '=' and 'like' in unicode

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group