Re: why the need for is null?

From: Gaetano Mendola <mendola(at)bigfoot(dot)com>
To: Martijn van Oosterhout <kleptog(at)svana(dot)org>
Subject: Re: why the need for is null?
Date: 2004-01-03 11:08:48
Message-ID: 3FF6A2C0.7010309@bigfoot.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Chris Travers 2004-01-03 12:30:17 Re: why the need for is null?
Previous Message Christopher Kings-Lynne 2004-01-03 06:49:23 Re: Postgres + Xapian (was Re: fulltext searching via a