BUG #4999: select 'a' < 'A' is true, but should be false . . . - Mailing list pgsql-bugs

From Brian Ceccarelli
Subject BUG #4999: select 'a' < 'A' is true, but should be false . . .
Date
Msg-id 200908202024.n7KKOrPp030815@wwwmaster.postgresql.org
Whole thread Raw
Responses Re: BUG #4999: select 'a' < 'A' is true, but should be false . . .  (Tom Lane <tgl@sss.pgh.pa.us>)
Re: BUG #4999: select 'a' < 'A' is true, but should be false . . .  (Peter Eisentraut <peter_e@gmx.net>)
List pgsql-bugs
The following bug has been logged online:

Bug reference:      4999
Logged by:          Brian Ceccarelli
Email address:      ceccareb@talussoftware.com
PostgreSQL version: 8.4.0 to 8.2.13
Operating system:   Linux and XP
Description:        select 'a' < 'A' is true, but should be false . . .
Details:

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 would
imply that 'a' = 'A', but 'a' < 'A' is true.

- - -

The operator equals is case sensitive.
The operator < and > are case-insensitive.
This is not consistent.

Most of the time, operator < and > are case-insenstive, until you compare
the upper and lower cases of the same letter.

pgsql-bugs by date:

Previous
From: "Dmitry Samokhin"
Date:
Subject: Re: BUG #4997: Expression evaluation rules
Next
From: "Brian Ceccarelli"
Date:
Subject: BUG #5000: Optimizer does not use function-based index for an order by