not null - trivial, unexpected behavior

From: John Scott <jmscott(at)yahoo(dot)com>
To: pgsql-sql(at)postgresql(dot)org
Subject: not null - trivial, unexpected behavior
Date: 2001-06-16 15:16:11
Message-ID: 20010616151611.40654.qmail@web10006.mail.yahoo.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

the following behaviour seems inconsistent to me.
I can qualify on nulls, but not on nonullness.

This was tested under 7.1.2

create table A
(
a text,
b text
);

insert into A(a) values('a1');
insert into A(a, b) values('a2', 'b2');

select count(*) from A where b = null; /* Returns 1, ok */
select count(*) from A where b != null; /* Returns 0 ... not ok! */

What am i missing? Shouldn't those two sets be complimentary?

john

=====
John Scott
Senior Partner
August Associates

email: john(at)august(dot)com
web: http://www.august.com/~jmscott

__________________________________________________
Do You Yahoo!?
Spot the hottest trends in music, movies, and more.
http://buzz.yahoo.com/

Responses

Browse pgsql-sql by date

  From Date Subject
Next Message Rene Pijlman 2001-06-16 15:28:06 Re: not null - trivial, unexpected behavior
Previous Message Postgresql 2001-06-16 12:56:17 calling user defined function with parameters..