| From: | "j6m" <j6m(at)cvni(dot)net> |
|---|---|
| To: | <pgsql-bugs(at)postgresql(dot)org>, "BogDan Vatra" <bog_dan_ro(at)yahoo(dot)com> |
| Subject: | Re: BUG #1921: NULL<>NULL ?!?!?!?!?!?!? |
| Date: | 2005-09-29 15:02:39 |
| Message-ID: | 004501c5c507$75e4a990$1500020a@eden.fr |
| Views: | Whole Thread | Raw Message | Download mbox | Resend email |
| Thread: | |
| Lists: | 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(at)yahoo(dot)com>
To: <pgsql-bugs(at)postgresql(dot)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 ;
| From | Date | Subject | |
|---|---|---|---|
| Next Message | Sorin Schwimmer | 2005-09-29 16:47:37 | BUG #1922: bit string of calculated length |
| Previous Message | Gaetano Mendola | 2005-09-29 13:49:36 | Re: BUG #1921: NULL<>NULL ?!?!?!?!?!?!? |