Re: very big problem with NULL

From: Vivek Khera <khera(at)kcilink(dot)com>
To: pgsql-general(at)postgresql(dot)org
Subject: Re: very big problem with NULL
Date: 2001-06-08 15:27:05
Message-ID: x7n17jf0vq.fsf@onceler.kciLink.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

>>>>> "g" == grant <grant(at)xactcommerce(dot)com> writes:

g> However, the last time i checked, NULL does not equal to 1, 2, 3,
g> or anything else besides NULL. Thats why I'm confused as to why
g> SELECT column FROM table WHERE column != 1 also excludes NULL,
g> because 1 does NOT have the same value as NULL.

Ok, NULL is not equal to 1, 2, 3, or anything else. It is also not
equal to itself, and it is not inequal to anything. NULL is special.

If you want to treat it the same as zero in your app, then you are
setting up your tables incorrectly. Make your column "NOT NULL
default 0".

--
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
Vivek Khera, Ph.D. Khera Communications, Inc.
Internet: khera(at)kciLink(dot)com Rockville, MD +1-240-453-8497
AIM: vivekkhera Y!: vivek_khera http://www.khera.org/~vivek/

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Jonathan Bartlett 2001-06-08 15:31:11 RE: PostgreSQL 7.1 and ORACLE 8.x
Previous Message Jonathan Bartlett 2001-06-08 15:26:57 Re: maximum number of rows in table - what about oid limits?