Re: Select .... where id not in (....) returns 0 incorrectly

From: Mladen Gogala <gogala(dot)mladen(at)gmail(dot)com>
To: pgsql-general(at)lists(dot)postgresql(dot)org
Subject: Re: Select .... where id not in (....) returns 0 incorrectly
Date: 2022-04-05 23:25:24
Message-ID: 71a6ae74-79ca-09c6-2e9c-a7f4d86b176f@gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Peter J. Holzer 2022-04-06 06:19:57 Re: Select .... where id not in (....) returns 0 incorrectly
Previous Message Michael Lewis 2022-04-05 17:01:16 Re: Serializable read only deferrable- implications