Re: why the need for is null?

From: Martijn van Oosterhout <kleptog(at)svana(dot)org>
To: Baldur Norddahl <bbn-pgsql(dot)general(at)clansoft(dot)dk>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: why the need for is null?
Date: 2004-01-01 23:13:10
Message-ID: 20040101231310.GC7723@svana.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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(at)svana(dot)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

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Christopher Browne 2004-01-01 23:28:41 Re: why the need for is null?
Previous Message Mark Kirkwood 2004-01-01 22:58:47 Re: why the need for is null?