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

BUG #2262: WHERE-clause comparisons wrong

From: "Richard Baverstock" <richard(at)3dtechnologies(dot)ca>
To: pgsql-bugs(at)postgresql(dot)org
Subject: BUG #2262: WHERE-clause comparisons wrong
Date: 2006-02-14 19:39:51
Message-ID: 20060214193951.0562DF0B05@svr2.postgresql.org (view raw or flat)
Thread:
Lists: pgsql-bugs
The following bug has been logged online:

Bug reference:      2262
Logged by:          Richard Baverstock
Email address:      richard(at)3dtechnologies(dot)ca
PostgreSQL version: 8.1
Operating system:   Windows XP Pro
Description:        WHERE-clause comparisons wrong
Details: 

History: Imported data from an 8.0 to 8.1 server. The 8.0 server was set to
use whatever the default encoding was on win32; the 8.1 server is set to use
utf8. Import using a dump from the 8.0 server went fine.

Problem: When querying the database, any requirements for "WHERE" that
involve comparing strings with spaces or dashes/hyphens return false, when
they should be true.

For example; assuming a table called inventory has a column named "Number"
(varchar), and a row has the value 'ABC 123' for the number, the following
returns the correct row:

select "Number" from "inventory" where "Number" LIKE 'ABC%';

however, the following two queries return no rows:

select "Number" from "inventory" where "NUMBER" LIKE 'ABC %';
select "Number" from "inventory" where "Number" = 'ABC 123';


IF however, the Number being searched for was not imported from the 8.0
database, everything is fine. The space as returned by the successful query
is the correct hex value (0x20).

pgsql-bugs by date

Next:From: Andrew KlostermanDate: 2006-02-14 19:52:02
Subject: Re: BUG #2246: Bad malloc interactions: ecpg, openssl
Previous:From: Andrew KlostermanDate: 2006-02-14 19:21:11
Subject: Re: BUG #2246: Bad malloc interactions: ecpg, openssl

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