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

Bug #821: bug when using between or <= on varchar fields

From: pgsql-bugs(at)postgresql(dot)org
To: pgsql-bugs(at)postgresql(dot)org
Subject: Bug #821: bug when using between or <= on varchar fields
Date: 2002-11-19 17:25:45
Message-ID: 20021119172545.A5753475B84@postgresql.org (view raw or flat)
Thread:
Lists: pgsql-bugs
Thomas Piszczek (t(dot)piszczek(at)tallence(dot)com) reports a bug with a severity of 3
The lower the number the more severe it is.

Short Description
bug when using between or <= on varchar fields

Long Description
I just recognized that when using between or <= and >= on varchar fields postgresql behaves quite strange. If i search for users in my user table which does contain last_name entries beginning with o or p and have an sql that searches for "lower(last_name)>='k' and lower(last_name)<='o'" i get all results between k and n, but no "o-entries". If i do a "lower(last_name)>='k' and lower(last_name)<=p it works. I then get all results between k and o(no p's).
Using "between 'k' and 'o'" behaves just the same.
I think this is a bug(i'm using postgresql 7.2.3 on suse linux 8.1 with php 4.2.3)

Sample Code
SELECT user_id,.......
FROM cma_user
WHERE
LOWER(last_name)>='k' AND LOWER(last_name)<='o'

SELECT user_id,.......
FROM cma_user
WHERE
LOWER(last_name) BETWEEN 'k' AND 'o'



No file was uploaded with this report


Responses

pgsql-bugs by date

Next:From: Stephan SzaboDate: 2002-11-19 17:31:08
Subject: Re: Bug #821: bug when using between or <= on varchar fields
Previous:From: Kristofer MunnDate: 2002-11-19 04:08:40
Subject: Re: Bug #820: RULE on INSERT unable to access NEW

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