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

From: "Brian Ceccarelli" <ceccareb(at)talussoftware(dot)com>
To: pgsql-bugs(at)postgresql(dot)org
Subject: BUG #4999: select 'a' < 'A' is true, but should be false . . .
Date: 2009-08-20 20:24:53
Message-ID: 200908202024.n7KKOrPp030815@wwwmaster.postgresql.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs


The following bug has been logged online:

Bug reference: 4999
Logged by: Brian Ceccarelli
Email address: ceccareb(at)talussoftware(dot)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.

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message Brian Ceccarelli 2009-08-20 20:30:56 BUG #5000: Optimizer does not use function-based index for an order by
Previous Message Dmitry Samokhin 2009-08-20 14:27:54 Re: BUG #4997: Expression evaluation rules