Seq nr | Name▲ | Goal | Type | Data source | Last update | License | ... |
---|---|---|---|---|---|---|---|
1 | Candidate keys where all columns have a static default value | Find base table primary key and unique constraints where all columns probably have a static default value. Candidate key columns (columns that belong to the primary key or to an unique constraints) shouldn't have static default values unless you are enforcing a rule that a table can have at most one row. The point of default values is that system assigns them automatically. There cannot be multiple rows with the same key value. | Problem detection | INFORMATION_SCHEMA+system catalog base tables | 2023-11-12 11:33 | MIT License | |
2 | CHAR or VARCHAR columns have a default value that length is longer from the character maximum length of the column | Find table columns with CHAR or VARCHAR type that have a default value that length is longer from the character maximum length of the column. Choose a suitable data type, field size, and default value. If the value is longer, then it is impossible to register it in a field, i.e., it makes registration of data impossible (except if the excessive characters are spaces). | Problem detection | INFORMATION_SCHEMA only | 2022-10-31 10:19 | MIT License | |
3 | CHECK constraint cardinality is zero | Write correct constraints. Usually the constraint expression should refer to at least one column. A domain constraint expression should refer to the stub VALUE. For instance, the constraint CHECK(1=0) that is associated with a table T would prevent adding any rows to T. The value of the Boolean expression of this constraint is always FALSE. | Problem detection | INFORMATION_SCHEMA+system catalog base tables | 2022-04-22 17:06 | MIT License | |
4 | Completely overlapping foreign keys | Find completely overlapping foreign keys, i.e., the same set of columns of a table is covered by more than one foreign key constraint. These constraints could refer to the same table/key or different tables/keys. | Problem detection | INFORMATION_SCHEMA+system catalog base tables | 2021-02-25 17:30 | MIT License | |
5 | Functions that have transactional control | Find functions that contain transactional control statements (BEGIN, START TRANSACTION, COMMIT, ROLLBACK, SAVEPOINT) in their body. PostgreSQL does not permit transaction control in functions. | Problem detection | INFORMATION_SCHEMA+system catalog base tables | 2021-11-04 10:50 | MIT License | |
6 | Incorrect check of NULLs | Find the use of =NULL and <>NULL in case of table level check constraints, domain level check constraints, WHEN clauses of triggers, WHERE clauses of rules, subqueries of derived tables, and bodies of routines. Write correct code. In order to determine as to whether a value is missing or not one has to use the IS [NOT] NULL predicate. NULL is the marker in SQL that denotes a missing value. Although it is often called "NULL value", one cannot treat it as an ordinary value, i.e., use it in comparisons as a value. | Problem detection | INFORMATION_SCHEMA+system catalog base tables | 2023-11-12 12:10 | MIT License | |
7 | Invalid character class | PostgreSQL regular expressions do not have character classes word and letter. | Problem detection | INFORMATION_SCHEMA+system catalog base tables | 2021-11-04 12:50 | MIT License | |
8 | Invalid use of the case insensitive search modifier in regular expressions | Find regular expression patterns that use (?i) modifier in any other place than at the beginning of the pattern or (?-i) in any place of the pattern. Such use of the modifiers is not supported by PostgreSQL. | Problem detection | INFORMATION_SCHEMA+system catalog base tables | 2021-11-04 16:06 | MIT License | |
9 | Recursive relationships with the same source and target | Find incorrectly implemented adjacency lists. | Problem detection | system catalog base tables only | 2021-02-25 17:30 | MIT License | |
10 | Some candidate key values cannot be used as foreign key values | Find foreign key constraints in case of which some candidate key values cannot be used as foreign key values. Primary key/unique columns and foreign key columns should have the same data type and field size. If, for instance, the primary key column has type INTEGER and foreign key column has type SMALLINT, then one cannot use all the primary key values as foreign key values. | Problem detection | INFORMATION_SCHEMA+system catalog base tables | 2021-03-10 12:13 | MIT License |