How NULL is interpreted in Pgsql

Поиск
Список
Период
Сортировка
От Guru Prasad
Тема How NULL is interpreted in Pgsql
Дата
Msg-id Pine.LNX.4.20.0105151323560.16374-100000@Larry.bks
обсуждение исходный текст
Ответы Re: How NULL is interpreted in Pgsql
Список pgsql-sql
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 | bolt1002.000000 | nut1003.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
-------------------------------------------------------------------------------





В списке pgsql-sql по дате отправления:

Предыдущее
От: Michael Davis
Дата:
Сообщение: RE: Auto incrementing an integer
Следующее
От: Justin Clift
Дата:
Сообщение: Re: error message...