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