is NULL = NULL true or false? - Mailing list pgsql-general

From Gene Selkov, Jr.
Subject is NULL = NULL true or false?
Date
Msg-id 199811091757.LAA03182@antares.mcs.anl.gov
Whole thread Raw
List pgsql-general
Hi,

I am joining two or more tables on the column that has quite a number
of nulls, assuming 'a.key = b.key' to be a valid expression even when
both operands are NULLs. The result set is way smaller that I
expect. Could that be because the two NULLs do not match?

I guess there are two possible ways to treat the NULL = NULL
problem. One is to say, "Don't know. There is no information to say
whether this is true or false". The second is to say, "Yes, these two
entities are the same. They are equally undetermined".

The function I want to achieve is:

'a.key = b.key' OR ((a.key IS NULL) AND (b.key IS NULL))

Isn't it the way it's wired?


--Gene

pgsql-general by date:

Previous
From: Herouth Maoz
Date:
Subject: Re: [GENERAL] Incrementing a Serial Field
Next
From: David Hartwig
Date:
Subject: Re: [GENERAL] postgreSQL 6.3.2 and AIX