Re: BUG #1921: NULL<>NULL ?!?!?!?!?!?!? - Mailing list pgsql-bugs

From j6m
Subject Re: BUG #1921: NULL<>NULL ?!?!?!?!?!?!?
Date
Msg-id 004501c5c507$75e4a990$1500020a@eden.fr
Whole thread Raw
In response to BUG #1921: NULL<>NULL ?!?!?!?!?!?!?  ("BogDan Vatra" <bog_dan_ro@yahoo.com>)
List pgsql-bugs
Hi,

The SQL standard requires that null values do not equate any value,
including themselves.

Corrected syntax of your queries is shown below.

If I recall it correctly, this nehaviour was enforced in the 7.2->7.3 or
7.1->7.2 evolution.

If for instance a char(1) field called 'myfield' admits several values
rangeing from 'A' to 'I' and null, extracting all rows where char is neither
'C' or 'F' should imply the following where-clause

... where myfield is null or myfield is not in ('C','F')

A cluase like "where myfield is not in ('C','F')" would not extract all rows
where myfield is null.

Hope this helps

Regards
J6M

----- Original Message -----
From: "BogDan Vatra" <bog_dan_ro@yahoo.com>
To: <pgsql-bugs@postgresql.org>
Sent: Thursday, September 29, 2005 10:38 AM
Subject: [BUGS] BUG #1921: NULL<>NULL ?!?!?!?!?!?!?


>

>
> create table test (id serial, tt varchar(50));
> insert into test (tt) values(NULL);
> select tt from test where tt=NULL;

select tt from test where tt is null ;

>
> select tt from test where tt<>NULL;

select tt from test where tt is not null ;

pgsql-bugs by date:

Previous
From: Gaetano Mendola
Date:
Subject: Re: BUG #1921: NULL<>NULL ?!?!?!?!?!?!?
Next
From: "Magnus Hagander"
Date:
Subject: Re: BUG #1920: Installer no WIN1252 & UTF8 selection