Re: why the need for is null? - Mailing list pgsql-general

From Gaetano Mendola
Subject Re: why the need for is null?
Date
Msg-id 3FF6A2C0.7010309@bigfoot.com
Whole thread Raw
In response to Re: why the need for is null?  (Martijn van Oosterhout <kleptog@svana.org>)
List pgsql-general
Martijn van Oosterhout wrote:

> On Thu, Jan 01, 2004 at 11:53:29PM +0100, Baldur Norddahl wrote:
>
>>Ok, but since this can be quite annoying and unexpected, could we get an
>>operator that does not use tristate logic but simply compares? Maybe == which
>>seems to be free :-)
>>
>>So X==Y is true if X and Y are equal or both are null, false othervise.
>
>
> Annoying, not really. It's actually extremely useful. It's useful having a
> value which is never equal to anything else, not even itself. If you use it
> to represent "unknown" it will work for you. If you try to use it for
> anything else, it will bite you.
>
> You could create a new operator, but that means you'll have difficulty
> moving it to any database that doesn't have that operator (which is most of
> them).
>
> If you want it to match perhaps you should forget NULL and use '' (zero
> length string) instead.

Don't mentioning the fact that for Oracle a zero length string is NULL!
Isn't that funny ?

Regards
Gaetano Mendola

pgsql-general by date:

Previous
From: Tom Lane
Date:
Subject: Re: Bug and/or feature? Complex data types in tables...
Next
From: "Joshua D. Drake"
Date:
Subject: Re: website doc search is extremely SLOW