Seq nr | Name | Goal | Type | Data source | Last update▼ | License | ... |
---|---|---|---|---|---|---|---|
1 | SQL routines that return the value of an input parameter | Find SQL routines that return the value of an input parameter. | Problem detection | INFORMATION_SCHEMA+system catalog base tables | 2025-01-20 14:23 | MIT License | |
2 | Check as to wheteher the names of columns are in the plural or in the singular form (Estonian version) | Check as to wheteher the names of tables are in the plural or in the singular form. Make sure that you are consistent in naming. | General | INFORMATION_SCHEMA+system catalog base tables | 2025-01-15 14:20 | MIT License | |
3 | Check as to wheteher the names of parameters are in the plural or in the singular form (Estonian version) | Check as to wheteher the names of routine parameters are in the plural or in the singular form. Make sure that you are consistent in naming. | General | INFORMATION_SCHEMA+system catalog base tables | 2025-01-15 14:19 | MIT License | |
4 | Inconsistent use of plural and singular in table names in the context of a relationship (Estonian version) | Find foreign key constraints in case of which the name of one of the tables is in plural and the name of another table is in singular. | Problem detection | INFORMATION_SCHEMA+system catalog base tables | 2025-01-15 14:18 | MIT License | |
5 | Duplicate removal of duplicates in derived tables | Find derived tables (views and materialized views) that contain both DISTINCT and GROUP BY. Make sure that the means for removing duplicate rows from the query result are not duplicated. | Problem detection | INFORMATION_SCHEMA+system catalog base tables | 2025-01-15 14:16 | MIT License | |
6 | ROW level BEFORE DELETE and INSTEAD OF DELETE triggers that procedures refer to the row variable NEW | Do not write incorrect code. Variable NEW: "Data type RECORD; variable holding the new database row for INSERT/UPDATE operations in row-level triggers. This variable is null in statement-level triggers and for DELETE operations." (PostgreSQL documentation) | Problem detection | INFORMATION_SCHEMA+system catalog base tables | 2024-12-28 11:31 | MIT License | |
7 | ROW level BEFORE INSERT and INSTEAD OF INSERT triggers that procedures refer to the row variable OLD | Do not write incorrect code. Variable OLD: "Data type RECORD; variable holding the old database row for UPDATE/DELETE operations in row-level triggers. This variable is null in statement-level triggers and for INSERT operations." (PostgreSQL documentation) | Problem detection | INFORMATION_SCHEMA+system catalog base tables | 2024-12-28 11:27 | MIT License | |
8 | Incorrect prefix of a constraint name or an index name | If the name of an object has the prefix that refers to the type of the object (for instance, primary key constraint or foreign key constraint), then you should use references to the correct object type. Find prefixes of constraint names and index names that incorrectly refer to the type of the object. For instance, incorrect would be to use chk_ as the prefix of an index name or pk_ as the prefix of a check constraint name. | Problem detection | INFORMATION_SCHEMA+system catalog base tables | 2024-12-28 10:48 | MIT License | |
9 | Incorrect suffix of a constraint name or an index name | If the name of an object has the suffix that refers to the type of the object (for instance, primary key constraint or foreign key constraint), then you should use references to the correct object type. Find suffixes of constraint names and index names that incorrectly refer to the type of the object. For instance, incorrect would be to use _chk as the suffix of an index name or _pk as the suffix of a check constraint name. | Problem detection | INFORMATION_SCHEMA+system catalog base tables | 2024-12-28 10:44 | MIT License | |
10 | Base table columns permitting empty strings and strings that consist of only whitespace characters (2) | Find non-foreign key columns of base tables that have a textual type and do not have a simple CHECK constraint (i.e., a constraint that involves only one column) that seems to prohibit empty strings and strings that consist of only whitespace as well as a simple CHECK constraint that specifies permitted symbols. | Problem detection | INFORMATION_SCHEMA+system catalog base tables | 2024-12-27 19:02 | MIT License | |
11 | Perhaps unnecessay regular expression | Find occurrences of possibly pointless regular expressions - i.e., value contains zero or more symbols. | Problem detection | INFORMATION_SCHEMA+system catalog base tables | 2024-12-27 18:37 | MIT License | |
12 | Perhaps a too long PL/pgSQL routine | A large routine may have multiple tasks that should be split between multiple routines, each of which has a more focused task. Find the PL/pgSQL routines where the number of physical lines of code is bigger than 40. | Problem detection | INFORMATION_SCHEMA+system catalog base tables | 2024-12-27 11:13 | MIT License | |
13 | Routines with BOOLEAN return type that do not have a good name | The prefic of the name should be "is_" or "has_" or "can_" (in English) or "on_" (in Estonian). Worse: check_rights. Better: has_rights. | Problem detection | INFORMATION_SCHEMA+system catalog base tables | 2024-12-27 11:12 | MIT License | |
14 | The usage of data type formatting functions | Find expressions that use a data type formatting function - to_char, to_number, to_date, to_timestamp. | General | INFORMATION_SCHEMA+system catalog base tables | 2024-12-25 19:57 | MIT License | |
15 | Perhaps unnecessary Trim | Find constraints where the use of Trim function is possibly unnecessary. CHECK constraint column!~'^[[:space:]]*$' already ensures that the values in the column cannot be empty strings or strings that consist of only whitespace. Trim(Column)!~'^[[:space:]]*$' - in this case the use of Trim function is unnecessary. | Problem detection | INFORMATION_SCHEMA only | 2024-12-25 15:27 | MIT License | |
16 | NOT IN or <> ALL in derived tables | Avoid using NOT IN or <>ALL with a non-correlated subquery in PostgreSQL because the query performance will be very poor, especially in case of large data sizes. | Problem detection | INFORMATION_SCHEMA+system catalog base tables | 2024-12-24 13:50 | MIT License | |
17 | NOT IN or <> ALL in routines | Avoid using NOT IN or <>ALL with a non-correlated subquery in PostgreSQL because the query performance will be very poor. | Problem detection | INFORMATION_SCHEMA+system catalog base tables | 2024-12-24 13:50 | MIT License | |
18 | Duplicate check of empty strings | Find columns that have a check that prevents the empty string in the column but there is already another check on the column that enforces the constraint. If there is a constraint description!~'^[[:space:]]*$', then it covers the constraint description!='' and the latter becomes redundant. | Problem detection | INFORMATION_SCHEMA+system catalog base tables | 2024-12-23 14:28 | MIT License | |
19 | Perhaps is not a snake case - date, time, or by is not preceded by an underscore | Find names that perhaps do not use the snake_case naming style because the name ends with the phrase "date", "time", "by" that is not preceded by an underscore. Prefer snake_case over PascalCase and camelCase in names. | Problem detection | INFORMATION_SCHEMA+system catalog base tables | 2024-12-23 13:56 | MIT License | |
20 | IS DISTINCT FROM should be used instead of <> in WHEN clauses | Use a right predicate in trigger condition in order to ensure that the trigger executes always when it has to but not more often. IS DISTINCT FROM treats NULL as if it was a known value, rather than unknown. It would be relevant if a column that is referenced in the action condition is optional, i.e., permits NULLs. | Problem detection | INFORMATION_SCHEMA only | 2024-12-23 12:29 | MIT License |