Seq nr | Name | Goal | Type | Data source | Last update▼ | License | ... |
---|---|---|---|---|---|---|---|
821 | Potentially missing PRIMARY KEY or UNIQUE constraints (based on foreign keys) | All the keys must be enforced. Find base tables that implement M:N relationship types and that allow multiple relationships of the same type between the same entities. | Problem detection | INFORMATION_SCHEMA+system catalog base tables | 2021-02-25 17:29 | MIT License | |
822 | Preventing strings that consist of only spaces instead of strings that consist of only whitespace characters | Find columns of base tables and foreign tables where one uses a check constraint to prevent values that consist of only spaces. Make sure that this is the correct constraint and there is no need to prevent values that consist of only whitespace characters. | Problem detection | INFORMATION_SCHEMA only | 2021-02-25 17:29 | MIT License | |
823 | Redundant indexes | Find indexes that may be redundant. In addition to identical indexes it also considers indexes that cover the same columns and have the same properties except uniqueness. The query considers all types of indexes, including indexes that have been automatically created to support a constraint and function-based indexes. | Problem detection | system catalog base tables only | 2021-02-25 17:29 | MIT License | |
824 | Should the time zone be recorded in case of time or not? | Find all the base table columns that have the type time without time zone or time with time zone. Return the data only if there is at least one column with the type time without time zone and one column with the type time with time zone. | Problem detection | INFORMATION_SCHEMA only | 2021-02-25 17:29 | MIT License | |
825 | Should the time zone be recorded in case of timestamp or not? | Find all the base table columns that have the type timestamp without time zone or timestamp with time zone. Return the data only if there is at least one column with the type timestamp without time zone and one column with the type timestamp with time zone. | Problem detection | INFORMATION_SCHEMA only | 2021-02-25 17:29 | MIT License | |
826 | Some CHECKS are associated with a domain and some with the base table columns that have the domain | Find cases where some CHECKS are associated with a domain and some with the base table columns that have the domain. Avoid duplication of code. Write as little code as possible. If possible, move things "before the brackets" so to say. In this case it means declaring CHECKS at the level of the domain and not at the level of base table columns. | Problem detection | INFORMATION_SCHEMA+system catalog base tables | 2021-02-25 17:29 | MIT License | |
827 | Sorting rows based on random values in derived tables | Find derived tables (views and materialized views) that sort rows based on random values. This can be used to find a random subset of rows. It is a computationally expensive operation. | Problem detection | INFORMATION_SCHEMA+system catalog base tables | 2021-02-25 17:29 | MIT License | |
828 | 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 | 2021-02-25 17:29 | MIT License | |
829 | Tables without columns | Do not have in a database elements that are not useful. PostgreSQL permits tables with no columns. Such tables can be used to implement Boolean variables (tables TABLE_DEE and TABLE_DUM). On the other hand, such tables might be a result of database evolution, where developers have not noticed that they have dropped all the columns of a table or have not noticed that they have created such a table in the first place. | Problem detection | INFORMATION_SCHEMA+system catalog base tables | 2021-02-25 17:29 | MIT License | |
830 | 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 | INFORMATION_SCHEMA only | 2021-02-25 17:29 | MIT License | |
831 | 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 | INFORMATION_SCHEMA+system catalog base tables | 2021-02-25 17:29 | MIT License | |
832 | The maximum number of characters may be missing | Perhaps the character maximum length has been omitted accidentally, i.e., one wrote VARCHAR instead of VARCHAR(n) where n is the maximum permitted number of characters in the field value. VARCHAR and TEXT are synonyms. | Problem detection | INFORMATION_SCHEMA only | 2021-02-25 17:29 | MIT License | |
833 | Too short domain constraint names | Find names of domain constraints that are shorter than the length of the name of the domain + two characters. | Problem detection | INFORMATION_SCHEMA only | 2021-02-25 17:29 | MIT License | |
834 | Too short table constraint names | The names should be expressive. Find names of constraints, which are associated directly to a table, that are shorter than the length of the name of the table + two characters. | Problem detection | system catalog base tables only | 2021-02-25 17:29 | MIT License | |
835 | Too short view names | Names should be expressive. Find views that name is shorter than the average length of the the names of its directly underlying tables (both base tables and derived tables). | Problem detection | INFORMATION_SCHEMA only | 2021-02-25 17:29 | MIT License | |
836 | Unnecessary domains | Domain is a reusable artifact. Effort of its creation should be paid off by the advantages that it offers. If a domain is used in case of at most one column of a base table or even if it is used in case of more than one column but it does not specify neither a default value nor a check constraint, then there is no point of creating the domain. | Problem detection | INFORMATION_SCHEMA+system catalog base tables | 2021-02-25 17:29 | MIT License | |
837 | Unused trigger functions | Do not keep in your database elements that are not needed by anybody. These should be put in use or dropped, otherwise these are dead code. | Problem detection | INFORMATION_SCHEMA+system catalog base tables | 2021-02-25 17:29 | MIT License | |
838 | UPDATE triggers that maybe execute too often | Do not let the system to do extra work. Ensure that trigger procedures are executed only if there is a real need of that. Find UPDATE triggers that could be executed too often because unneeded executions are not prevented. | Problem detection | INFORMATION_SCHEMA only | 2021-02-25 17:29 | MIT License | |
839 | Use invocation of a precise function instead of casting in a default value expression | Be precise and write as little code as possible. Prefer expressions with simple invocations of functions like localtimestamp, current_timestamp, and current_date over expressions like (now())::date. Find table columns that have a default value that casts the type of the returned value of a non-deterministic function (now, localtimestamp, current_timestamp, and current_date). | Problem detection | INFORMATION_SCHEMA only | 2021-02-25 17:29 | MIT License | |
840 | Username is not unique | Find textual columns that potentially contain usernames (including columns that potentially contain e-mail addresses) that do not have a unique constraint or a unique index that involves only this column. | Problem detection | INFORMATION_SCHEMA+system catalog base tables | 2021-02-25 17:29 | MIT License |