Re: null vs empty string - Mailing list pgsql-novice

From Rob Richardson
Subject Re: null vs empty string
Date
Msg-id 04A6DB42D2BA534FAC77B90562A6A03D01465CFF@server.rad-con.local
Whole thread Raw
In response to null vs empty string  (Kent Thomas <kent@solarbee.com>)
List pgsql-novice
The big thing to keep in mind when working with nulls is that NULL does
not mean that there is nothing in the field.  NULL means that the
database does not know what is in the field.  So, the only way to base a
selection on whether or not a field is NULL is to use the ISNULL()
function.  Also, no comparison with NULL will ever return true.  A query
like "SELECT * FROM SomeTable WHERE NULL = NULL" will return no records.
Since the database does not know what is in a NULL-valued field, it
cannot be confident that one such field is equal to another, and since
it's not confident, it has to return false.

RobR

pgsql-novice by date:

Previous
From: Kent Thomas
Date:
Subject: null vs empty string
Next
From: Thom Brown
Date:
Subject: Re: null vs empty string