Re: SET within a function?

From: Dennis Gearon <gearond(at)fireserve(dot)net>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Edmund Dengler <edmundd(at)eSentire(dot)com>, Mike Mascari <mascarm(at)mascari(dot)com>, Bruno Wolff III <bruno(at)wolff(dot)to>, pgsql-general(at)postgresql(dot)org
Subject: Re: SET within a function?
Date: 2003-10-15 16:45:27
Message-ID: 3F8D79A7.7080509@fireserve.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Tom Lane wrote:

>Edmund Dengler <edmundd(at)eSentire(dot)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.

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Alejandro Forero Cuervo 2003-10-15 16:55:07 Getting error codes for failed queries?
Previous Message Tom Lane 2003-10-15 16:10:56 Re: SET within a function?