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

From Alvaro Herrera
Subject Re: BUG #4999: select 'a' < 'A' is true, but should be false . . .
Date
Msg-id 20090826043454.GU12604@alvh.no-ip.org
Whole thread Raw
In response to Re: BUG #4999: select 'a' < 'A' is true, but should be false . . .  ("Brian Ceccarelli" <ceccareb@talusmusic.com>)
List pgsql-bugs
Brian Ceccarelli wrote:

> If the words are the same words but letters have different case, then the
> operator is case-sensitive.
> If the words are not the same words, then the operator is case-insensitive
> until the operator reaches the character position in both strings where the
> letters become different.

This is *exactly* how the collation is supposed to work (read: how it is
defined by the C library).  It is not a trivial single-pass comparison.
It is definitely not simply a case-sensitive or case-insensitive
comparison.

--
Alvaro Herrera                                http://www.CommandPrompt.com/
The PostgreSQL Company - Command Prompt, Inc.

pgsql-bugs by date:

Previous
From: Jaime Casanova
Date:
Subject: Re: BUG #4999: select 'a' < 'A' is true, but should be false . . .
Next
From: Craig Ringer
Date:
Subject: Re: BUG #4996: postgres.exe memory consumption keeps going up