Re: very big problem with NULL - Mailing list pgsql-general

From Vivek Khera
Subject Re: very big problem with NULL
Date
Msg-id x7n17jf0vq.fsf@onceler.kciLink.com
Whole thread Raw
List pgsql-general
>>>>> "g" == grant  <grant@xactcommerce.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@kciLink.com       Rockville, MD       +1-240-453-8497
AIM: vivekkhera Y!: vivek_khera   http://www.khera.org/~vivek/

pgsql-general by date:

Previous
From: Jonathan Bartlett
Date:
Subject: RE: PostgreSQL 7.1 and ORACLE 8.x
Next
From: Barry Jeapes
Date:
Subject: Where is libpq-fe.h?