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

From Martijn van Oosterhout
Subject Re: why the need for is null?
Date
Msg-id 20040101231310.GC7723@svana.org
Whole thread Raw
In response to Re: why the need for is null?  (Baldur Norddahl <bbn-pgsql.general@clansoft.dk>)
Responses Re: why the need for is null?
Re: why the need for is null?
Re: why the need for is null?
List pgsql-general
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.
--
Martijn van Oosterhout   <kleptog@svana.org>   http://svana.org/kleptog/
> (... have gone from d-i being barely usable even by its developers
> anywhere, to being about 20% done. Sweet. And the last 80% usually takes
> 20% of the time, too, right?) -- Anthony Towns, debian-devel-announce

Attachment

pgsql-general by date:

Previous
From: Mark Kirkwood
Date:
Subject: Re: why the need for is null?
Next
From: Tom Lane
Date:
Subject: Re: why the need for is null?