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

Re: BUG #4999: select 'a' < 'A' is true, but should be false . . .

From: "Brian Ceccarelli" <ceccareb(at)talusmusic(dot)com>
To: "'Peter Eisentraut'" <peter_e(at)gmx(dot)net>,"'Brian Ceccarelli'" <ceccareb(at)talussoftware(dot)com>
Cc: <pgsql-bugs(at)postgresql(dot)org>
Subject: Re: BUG #4999: select 'a' < 'A' is true, but should be false . . .
Date: 2009-08-24 12:24:20
Message-ID: 000601ca24b5$cf91a670$6eb4f350$@com (view raw, whole thread or download thread mbox)
Lists: pgsql-bugs
Yes.   I understand.   It has all to do with Unicode collating sequence.  I
need to somehow remove this bug from the list, since it is not a bug.

-----Original Message-----
From: pgsql-bugs-owner(at)postgresql(dot)org
[mailto:pgsql-bugs-owner(at)postgresql(dot)org] On Behalf Of Peter Eisentraut
Sent: Monday, August 24, 2009 4:54 AM
To: Brian Ceccarelli
Cc: pgsql-bugs(at)postgresql(dot)org
Subject: Re: [BUGS] BUG #4999: select 'a' < 'A' is true, but should be false
. . .

On tor, 2009-08-20 at 20:24 +0000, Brian Ceccarelli wrote:
> since the < and > comparison operators seem to be case insensitive:
> select 'a' < 'Z';    -- true
> select 'a' < 'z';    -- true
> select 'A' < 'Z';    -- true
> select 'A' < 'z';    -- true
> select 'z' < 'A';    -- false
> select 'z' < 'a';    -- false
> select 'Z' < 'A';    -- false
> select 'Z' < 'a';    -- false
> Any case A is < any case Z implies case-insensitive compare.    Which
> imply that 'a' = 'A', but 'a' < 'A' is true.

No, they are not "case insensitive".  The way this works is with a
multipass comparison algorithm: First, the letters are compared
independent of case, then the case is compared.  There is also an
additional pass for comparing accents, but I forget at the moment which
pass that is.  Search for Unicode collation algorithm, if you are

In response to


pgsql-bugs by date

Next:From: Miroslav TriscDate: 2009-08-24 15:00:25
Subject: BUG #5006: Backend crashed after select with subselect in where cluase
Previous:From: Sébastien LardièreDate: 2009-08-24 10:17:58
Subject: Re: BUG #5004: pg_freespacemap make a SegFault

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