In PostgreSQL 18, a table is created as CREATE TABLE c3 (x int CHECK (x > 0)); and then INSERT INTO c3 VALUES (NULL); is run. What happens?
Explanation
A check constraint is satisfied when the expression evaluates to true or to null, and NULL > 0 is null rather than false, so the row passes. Expecting a violation is the reason CHECK constraints are so often assumed to imply NOT NULL; enforcing that requires a separate not-null constraint.