BUG #6743: BETWEEN operator does not work for char(1) - Mailing list pgsql-bugs

From spatarel1@yahoo.com
Subject BUG #6743: BETWEEN operator does not work for char(1)
Date
Msg-id E1SrTXO-0003XB-HO@wrigleys.postgresql.org
Whole thread Raw
Responses Re: BUG #6743: BETWEEN operator does not work for char(1)
List pgsql-bugs
The following bug has been logged on the website:

Bug reference:      6743
Logged by:          Sp=C4=83t=C4=83rel Dan
Email address:      spatarel1@yahoo.com
PostgreSQL version: 9.1.4
Operating system:   Windows Vista SP2
Description:=20=20=20=20=20=20=20=20

I use "UTF8" charset and "Romania, Romanian" locale.

I came across this as I wanted to test if a symbol was a letter:

SELECT 'a' BETWEEN 'a' AND 'z'; -- true
SELECT 'z' BETWEEN 'a' AND 'z'; -- true
SELECT 'A' BETWEEN 'a' AND 'z'; -- true
SELECT 'Z' BETWEEN 'a' AND 'z'; -- false (!)
SELECT 'a' BETWEEN 'A' AND 'Z'; -- false (!)
SELECT 'z' BETWEEN 'A' AND 'Z'; -- true
SELECT 'A' BETWEEN 'A' AND 'Z'; -- true
SELECT 'Z' BETWEEN 'A' AND 'Z'; -- true

It seems that the intent is for the comparison to be case-insensitive, but
in some limit-cases it fails.

Please let me know if this turns out to be a real bug on not.

pgsql-bugs by date:

Previous
From: Craig Ringer
Date:
Subject: Re: main log encoding problem
Next
From: Alexander Law
Date:
Subject: Re: main log encoding problem