null-constraint (GN021)#
Automatic fix is available.
What it does#
Checks for use of NULL constraint.
Why not?#
From the documentation:
The NOT NULL constraint has an inverse: the NULL constraint. This does not mean that the column must be null, which would surely be useless. Instead, this simply selects the default behavior that the column might be null. The NULL constraint is not present in the SQL standard and should not be used in portable applications. (It was only added to PostgreSQL to be compatible with some other database systems.) Since it is the default for any column, its presence is simply noise.
When should you?#
Almost Never.
Use instead:#
Leave out NULL constraints.