Re: SET within a function? - Mailing list pgsql-general

From Dennis Gearon
Subject Re: SET within a function?
Date
Msg-id 3F8D79A7.7080509@fireserve.net
Whole thread Raw
In response to Re: SET within a function?  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-general
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.


pgsql-general by date:

Previous
From: "scott.marlowe"
Date:
Subject: Re: Cygwin? or paid version from SRA?
Next
From: Alejandro Forero Cuervo
Date:
Subject: Getting error codes for failed queries?