pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Guru Prasad <pnguruji@yahoo.com>
To: pgsql-sql@postgresql.org <pgsql-sql@postgresql.org>
Subject: How NULL is interpreted in Pgsql
Date: Tue, 15 May 2001 13:38:17 +0530 (IST)
Message-ID: <Pine.LNX.4.20.0105151323560.16374-100000@Larry.bks> (raw)


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
-------------------------------------------------------------------------------






view thread (3+ messages)  latest in thread

Message-ID: <Pine.LNX.4.20.0105151323560.16374-100000@Larry.bks>
Permalink:  ../Pine.LNX.4.20.0105151323560.16374-100000@Larry.bks/
Also on:    postgresql.org/message-id/Pine.LNX.4.20.0105151323560.16374-100000@Larry.bks

 · 

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 from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-sql@postgresql.org
  Cc: pnguruji@yahoo.com
  Subject: Re: How NULL is interpreted in Pgsql
  In-Reply-To: <Pine.LNX.4.20.0105151323560.16374-100000@Larry.bks>
  References: <Pine.LNX.4.20.0105151323560.16374-100000@Larry.bks>

* 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