pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Rene Pijlman <reageer.in@de.nieuwsgroep>
To: pgsql-sql@postgresql.org
Subject: Re: not null - trivial, unexpected behavior
Date: Sat, 16 Jun 2001 17:28:06 +0200
Message-ID: <odumit8vqilkh2l9kfiljlj88oa0e4e2fk@4ax.com> (raw)
References: <20010616151611.40654.qmail@web10006.mail.yahoo.com>

jmscott@yahoo.com (John Scott) schreef:
>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?  

The documentation :-)

"To check whether a value is or is not NULL, use the constructs 

expression IS NULL
expression IS NOT NULL

Do not use expression = NULL because NULL is not "equal to" NULL.
(NULL represents an unknown value, so it is not known whether two
unknown values are equal.) Postgres presently converts x = NULL
clauses to x IS NULL to allow some broken client applications (such as
Microsoft Access) to work, but this may be discontinued in a future
release."

http://www.postgresql.org/users-lounge/docs/7.1/postgres/functions-comparison.html

Regards,
René Pijlman
http://www.applinet.nl



view thread (10+ messages)  latest in thread

Message-ID: <odumit8vqilkh2l9kfiljlj88oa0e4e2fk@4ax.com>
Permalink:  ../odumit8vqilkh2l9kfiljlj88oa0e4e2fk@4ax.com/
Also on:    postgresql.org/message-id/odumit8vqilkh2l9kfiljlj88oa0e4e2fk@4ax.com

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-sql@postgresql.org
  Cc: reageer.in@de.nieuwsgroep
  Subject: Re: not null - trivial, unexpected behavior
  In-Reply-To: <odumit8vqilkh2l9kfiljlj88oa0e4e2fk@4ax.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox