Re: Select .... where id not in (....) returns 0 incorrectly - Mailing list pgsql-general

From Mladen Gogala
Subject Re: Select .... where id not in (....) returns 0 incorrectly
Date
Msg-id 71a6ae74-79ca-09c6-2e9c-a7f4d86b176f@gmail.com
Whole thread Raw
In response to Re: Select .... where id not in (....) returns 0 incorrectly  ("J. Roeleveld" <joost@antarean.org>)
Responses Re: Select .... where id not in (....) returns 0 incorrectly
List pgsql-general
On 4/4/22 09:21, J. Roeleveld wrote:
This was actually the case, I forgot there is 1 NULL-value in that list.
Personally, I think NULL should be treated as a seperate value and not lead to 
strange behaviour.

NULL is strange. Relational databases use ternary, not binary logic. In the woke vernacular, one could say that Postgres is non-binary. NULL literally means "no value". It is a part of the standard, so we have to deal with it, Codd help us. However, based on my lifelong experience with Oracle, NULL values are bad and are best avoided. Postgres is more forgiving than Oracle because in Postgres, the condition "is not null" can be resolved by index. In Oracle, it can not.

-- 
Mladen Gogala
Database Consultant
Tel: (347) 321-1217
https://dbwhisperer.wordpress.com

pgsql-general by date:

Previous
From: Michael Lewis
Date:
Subject: Re: Serializable read only deferrable- implications
Next
From: "Peter J. Holzer"
Date:
Subject: Re: Select .... where id not in (....) returns 0 incorrectly