BUG #4021: UUID NULL and not equal query failed - Mailing list pgsql-bugs

From Yann ROBIN
Subject BUG #4021: UUID NULL and not equal query failed
Date
Msg-id 200803091157.m29Bv1em003352@wwwmaster.postgresql.org
Whole thread Raw
Responses Re: BUG #4021: UUID NULL and not equal query failed
List pgsql-bugs
The following bug has been logged online:

Bug reference:      4021
Logged by:          Yann ROBIN
Email address:      yann.robin@withart.fr
PostgreSQL version: 8.3.0 build 140
Operating system:   Windows XP SP2
Description:        UUID NULL and not equal query failed
Details:

Hi,

I've tried to do a not like query on a UUID field and the row that i'd like
to get has a NULL value for the UUID field, it gives me no result. The
request :

SELECT *
FROM t_account
WHERE Update_Timestamp > '2008-03-09 12:35:10.309000' AND Update_Timestamp
<= '2008-03-09 12:35:37.861000' AND Update_Id !=
'48012851-3aa4-9940-9ab4-b8333da6b45b'

0 result.

The same request without the Update_Id condition :

SELECT *
FROM t_account
WHERE Update_Timestamp > '2008-03-09 12:35:10.309000' AND Update_Timestamp
<= '2008-03-09 12:35:37.861000'

1 result. The Update_Id field is null.

The same request but with a OR IS NULL condition :

SELECT *
FROM t_account
WHERE Update_Timestamp > '2008-03-09 12:35:10.309000' AND Update_Timestamp
<= '2008-03-09 12:35:37.861000'
AND (Update_Id != '48012851-3aa4-9940-9ab4-b8333da6b45b' OR Update_Id IS
NULL)

1 result.

So my conclusion is that the NOT EQUAL operator doesn't match how it should
the NULL value field.
Is it a bug or a wanted behavior ?


--
Yann

pgsql-bugs by date:

Previous
From: Alvaro Herrera
Date:
Subject: Re: BUG #4020: RFE: have way to log autovacuum activity
Next
From: "Yann ROBIN"
Date:
Subject: Re: BUG #3986: Error ts_vector with UTF8 WS2003