Tom Lane wrote:
>Edmund Dengler <edmundd@eSentire.com> writes:
>
>
>>Normally, when I am comparing rows, I do want NULL <> NULL.
>>
>>
>
>No, you still haven't got the point. NULL is not equal to NULL, and
>it is not not-equal-to NULL either. The result of the comparison is
>NULL, not true or false. This is consistent with the interpretation
>of NULL as "I don't know the value". If you don't know what the value
>is, you also don't know whether it is equal to some other value.
>
>
In these cases, it is recommended to either find a value which is out of
range, normally, and use that in place of NULL. For examples:
-1
10^32-1
"."
the_oldest_possible_date BC
the_furthest_away_date AD
Another way is to put an additional column in, but I think this still
has problems if you are trying to get a query to return values in a
column that has NULLs and you are querying against the column that has
the NULLs.