Why does null and true
evaluate to null
in PostgreSQL but null or true
evaluates to true
?
I would have thought using null
with and
or or
would've evaluated to null
in both cases?
nullpostgresql
Why does null and true
evaluate to null
in PostgreSQL but null or true
evaluates to true
?
I would have thought using null
with and
or or
would've evaluated to null
in both cases?
Best Answer
OR
is defined that if either side istrue
the expression evaluates totrue
.AND
is defined such that if both sides are true boolean-3VL context, the expression evaluates totrue
;null
is not true.