| 261 |
Do not assume you must use files (based on user data) |
Find cases where you store images and other media as files outside the database and store in the database only paths to the files. |
Problem detection |
INFORMATION_SCHEMA+system catalog base tables |
2025-11-07 10:11 |
MIT License |
View |
| 262 |
Perhaps too many subconditions in a CHECK constraint |
Find check constraints of base table and foreign table columns that are either associated with more than one column and have at least one AND operation or are associated with exactly one column and have two or more AND operations. |
Problem detection |
INFORMATION_SCHEMA only |
2025-11-07 10:11 |
MIT License |
View |
| 263 |
Table columns with NOT VALID CHECK constraints |
Find CHECK constraints of base table and foreign table columns that are not valid. These constraints have been created so that the existing data has not been checked against the constraint. It could be deliberate in case of legacy systems that have data quality problems. However, ideally all the data in the table conforms to the constraint. |
Problem detection |
INFORMATION_SCHEMA only |
2025-11-07 10:11 |
MIT License |
View |
| 264 |
CHECK constraints that perhaps do not consider 'infinity' and '-infinity' special values |
Find check constraints of base tables that cover exactly one column where the default value of the column is special value 'infinity' or '-infinity'. Find only such constraints that probably check a range of permitted values but do not consider that one of the values might be 'infinity' or '-infinity'. Such special values belong to the types DATE, TIMESTAMP, NUMERIC, REAL, and DOUBLE PRECISION. |
Problem detection |
INFORMATION_SCHEMA+system catalog base tables |
2025-11-07 10:11 |
MIT License |
View |
| 265 |
The expression of a check constraint that is associated with a domain needs type conversion |
Find check constraints of domains where the Boolean expression invokes an operation that does not match with the data type of the domain. |
Problem detection |
system catalog base tables only |
2025-11-07 10:11 |
MIT License |
View |
| 266 |
Perhaps checking of file extension is incorrect |
Find check constraints of tables that use a regular expression to check as to whether a registered string ends with an appropriate file extension. However, the expression does not put the dot sign into the square brackets nor does have the escape character \before it, i.e., it is interpreted as a single character not as the dot sign in the expression. In regular expressions the dot (.) matches any single character except the newline character. |
Problem detection |
INFORMATION_SCHEMA only |
2025-11-07 10:11 |
MIT License |
View |
| 267 |
Cannot register all legal e-mail addresses |
Find CHECK constraints on base table or foreign table columns that contain data about e-mail addresses and apply unnecessary restrictions to the these, rejecting potentially some legal addresses. More precisely, find CHECK constraints that prevent registration of e-mail addresses with multiple @ signs. |
Problem detection |
INFORMATION_SCHEMA+system catalog base tables |
2025-11-07 10:11 |
MIT License |
View |
| 268 |
Cannot register all legal personal names |
Find CHECK constraints on base table or foreign table columns that contain data about personal names and apply unnecessary restrictions to the names, rejecting potentially some legal names. Find checks that prohibit a digit or require a letter A-Z. |
Problem detection |
system catalog base tables only |
2025-11-07 10:11 |
MIT License |
View |
| 269 |
CHECK constraints on columns with personal names |
Find CHECK constraints on base table or foreign table columns that contain data about personal names. Make sure that the constraints do not restrict registration of legal names. |
General |
INFORMATION_SCHEMA only |
2025-11-07 10:11 |
MIT License |
View |
| 270 |
CHECK expression refers to time zone while it is unneccessary |
Find CHECK constraints on columns with type DATE or TIMESTAMP WITOUT TIME ZONE that refer to a time zone. |
Problem detection |
system catalog base tables only |
2025-11-07 10:11 |
MIT License |
View |
| 271 |
Not inherited CHECK constraints that cover at least one column |
Find CHECK constraints that cover at least one column and that have been defined in a supertable (parent table) but not in its subtables. An entity that belongs to a subtype should also belong to its supertype. If a subtype entity satisfies some constraint, then logically it must also satisfy the constraints of the supertype as well. If CHECK constraints are not inherited, then this is not guaranteed. If you implement subtyping not merely reuse implementation in the subtables, then the subtables must have at least the same CHECK constraints as the supertable. |
Problem detection |
system catalog base tables only |
2025-11-07 10:11 |
MIT License |
View |
| 272 |
Not inherited CHECK constraints |
Find CHECK constraints that have been defined in a supertable (parent table) but not in its subtables. An entity that belongs to a subtype should also belong to its supertype. If a subtype entity satisfies some constraint, then logically it must also satisfy the constraints of the supertype as well. If CHECK constraints are not inherited, then this is not guaranteed. If you implement subtyping not merely reuse implementation in the subtables, then the subtables must have at least the same CHECK constraints as the supertable. CHECK(false) on a supertable is an appropriate CHECK constraint if one wants to prevent registering data directly to the supertable, i.e., data can only be added to the subtables. |
General |
system catalog base tables only |
2025-11-07 10:11 |
MIT License |
View |
| 273 |
CHECK constraints on columns with Boolean data |
Find check constraints that involve columns with the type Boolean. |
General |
INFORMATION_SCHEMA only |
2025-11-07 10:11 |
MIT License |
View |
| 274 |
The expression of a simple check constraint that is associated directly with a column needs type conversion |
Find check constraints that involve one column and are associated directly with a table where the Boolean expression invokes an operation that does not match with the data type of the column. |
Problem detection |
system catalog base tables only |
2025-11-07 10:11 |
MIT License |
View |
| 275 |
Multicolumn CHECK constraints with with inconsistent Boolean expressions |
Find CHECK constraints that involve two columns, i.e., the cardinality of the constraint is 2, the columns have the same name in different tables, and the Boolean expressions of these constraints are different. For instance, in one table it is last_change_time>=reg_time and in another table it is not (reg_time>last_change_time). |
Problem detection |
system catalog base tables only |
2025-11-07 10:11 |
MIT License |
View |
| 276 |
IS NULL check is probably not needed |
Find CHECK constraints that refer only to mandatory columns but the Boolean expression has IS NULL condition. |
Problem detection |
INFORMATION_SCHEMA only |
2025-11-07 10:11 |
MIT License |
View |
| 277 |
CHECK constraints with unnecessary CHECK of NULLs |
Find CHECK constraints that unnecessarily check that a value is missing. In a CHECK constraint, it is not necessary to check whether a value is NULL, because a CHECK constraint rejects rows where the condition evaluates to FALSE and allows rows where the condition evaluates to TRUE or UNKNOWN. If a value is missing (i.e., NULL), the result of the check is UNKNOWN. Therefore, for example, CHECK (price IS NULL OR price > 0) is equivalent to CHECK (price > 0). |
Problem detection |
INFORMATION_SCHEMA+system catalog base tables |
2025-11-07 10:11 |
MIT License |
View |
| 278 |
Precise comparison with pattern matching in CHECK constraints |
Find CHECK constraints that use precise comparison (= or <>) with a regular expression or LIKE pattern. |
Problem detection |
INFORMATION_SCHEMA+system catalog base tables |
2025-11-07 10:11 |
MIT License |
View |
| 279 |
CHECK constraints with IS NULL |
Find CHECK constraints to one column (associated with a base table directly or through domain) that check that the value is missing (IS NULL). Write as simple constraint definitions as possible. By default columns are optional, i.e., they permit NULLs. NULL in a column means that checking of a CHECK constraint on the column results with UNKNOWN. CHECK constraints permit rows in case of which checking results with TRUE or UNKNOWN. In case of a CHECK constraint there is no need to check separately that a value in the column could be missing, i.e., be NULL. Thus, for instance, instead of writing CHECK (price>0 OR price IS NULL) write CHECK (price>0). |
Problem detection |
INFORMATION_SCHEMA+system catalog base tables |
2025-11-07 10:11 |
MIT License |
View |
| 280 |
Domain candidates |
Find column descriptions that are candidates for describing a domain. |
General |
INFORMATION_SCHEMA+system catalog base tables |
2025-11-07 10:11 |
MIT License |
View |