Havasvölgyi Ottó <h.otto@freemail.hu> writes:
> I have just run this command on 8.0.4 :
> SELECT 'foo' WHERE 0 NOT IN (NULL, 1);
> And it resulted is zero rows.
> Without NULL it is OK.
> Is this a bug, or the standard has such a rule?
This is per spec.
The computation is effectivelyNOT (0 = NULL OR 0 = 1)NOT (NULL OR FALSE)NOT NULLNULL
ie, the result is UNKNOWN, which WHERE treats the same as FALSE.
regards, tom lane