by beefield · 7y ago · 0 comments
SELECT null AND true;
SELECT bool_and(column1) FROM (VALUES (null::bool),(true)) AS foo;
In PostgreSQL the first query produces NULL, while the second produces TRUE. Yet, it's also possible to get NULL as a result of aggregating values with bool_and: SELECT bool_and(column1) FROM (VALUES (null::bool),(null::bool)) AS foo;
And that's not how a 3-valued logic works.