Received: from Donald.bks ([202.9.161.100]) by postgresql.org (8.11.3/8.11.1) with ESMTP id f4F86qA61416 for ; Tue, 15 May 2001 04:06:55 -0400 (EDT) (envelope-from pnguruji@yahoo.com) Received: from Larry.bks (root@Larry.bks [200.2.1.10]) by Donald.bks (8.8.5/8.8.5) with ESMTP id NAA01506 for ; Tue, 15 May 2001 13:37:46 +0530 Received: from Larry.bks (guru@Larry.bks [200.2.1.10]) by Larry.bks (8.9.3/8.8.5) with ESMTP id NAA17929 for ; Tue, 15 May 2001 13:38:17 +0530 Date: Tue, 15 May 2001 13:38:17 +0530 (IST) From: Guru Prasad To: "pgsql-sql@postgresql.org" Subject: How NULL is interpreted in Pgsql Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-Archive-Number: 200105/139 X-Sequence-Number: 2956 Dear Friends, I created a table with no 'unique constraints' which is depicted as follows. create table junk (id int, name varchar); Then, i inserted some records into the table. My table contents is listed below. id | name -------------+------ 1001.000000 | bolt 1002.000000 | nut 1003.000000 | 11.000000 | screw | cutter | cutting table Then, i gave a select query for the above table. The select query is 'select * from junk where id != 11'; To my surprise, it displayed all the records except those which had 'NULL' in the 'id' field. How is that possible ? (I mean it should displayed all the records except the matching condition). But, if i set PRIMARY KEY constraint to 'junk' table then it displays all the records (I can't say NULL here, but i can say '0'). How NULL is processed in Postgres. Could any one has some clue. Regards, guru. bk SYSTEMS (P) Ltd. P . N . G U R U P R A S A D -------------------------------------------------------------------------------