Seq nr | Name | Goal | Type | Data source | Last update▼ | License | ... |
---|---|---|---|---|---|---|---|
121 | Perhaps default value 'infinity' is missing | Find optional base table columns that have a timestamp type and do not have a default value. | Problem detection | INFORMATION_SCHEMA only | 2024-11-28 14:58 | MIT License | |
122 | The same CHECK has a different name in different places (2) | Find the names of table CHECK constraints that have the same Boolean expression but a different naming style in different places (tables). The naming of constraints should be consistent. "If you do something a certain way, do all similar things in the same way." (Robert C. Martin, Clean Code) | Problem detection | system catalog base tables only | 2024-11-28 14:47 | MIT License | |
123 | The same CHECK has a different name in different places | Find the names of table CHECK constraints that have the same Boolean expression but a different naming style in different places (tables). The naming of constraints should be consistent. "If you do something a certain way, do all similar things in the same way." (Robert C. Martin, Clean Code)x | Problem detection | system catalog base tables only | 2024-11-28 14:44 | MIT License | |
124 | Perhaps the type of a base table column/domain should be SMALLINT (based on classifiers) | Find columns that name points to the possibility that values in this are classifier codes. The column has a numeric type but it is not SMALLINT. Usually each classifier type has so few values that type SMALLINT would be appropriate. | Problem detection | INFORMATION_SCHEMA only | 2024-11-28 13:23 | MIT License | |
125 | Inconsistent chain of relationships in terms of using ON UPDATE compensating action | In case of a chain of relationships between tables (where the primary key and the foreign key have the same columns) the use of ON UPDATE compensating action should be consistent. For instance, in the next example there is inconsistency, because if one changes the person_code in table Person, then the modification does not succeed because it does not cascade to the table Product. It is unclear as to whether it should be possible to change the person_code or not. Person (person_code, surname) Primary key (person_code) Worker(person_code) Primary key (person_code) Foreign key (person_code) References Person (person_code) ON UPDATE CASCADE Product(product_code, registrator) Primary key (product_code) Foreign key (registrator) References Worker (person_code) ON UPDATE NO ACTION | Problem detection | system catalog base tables only | 2024-11-28 12:43 | MIT License | |
126 | Cascading update is not needed (based on surrogate keys) | Find foreign key constraints that reference to a candidate key that is a surrogate key, i.e., its values are generated by the system by using sequence generators. Do not use ON UPDATE CASCADE, ON UPDATE SET NULL, and ON UPDATE SET DEFAULT in case of foreign keys that reference to surrogate keys. | Problem detection | INFORMATION_SCHEMA+system catalog base tables | 2024-11-28 12:31 | MIT License | |
127 | Non-foreign key base table columns with the same name have a different set of CHECK constraints | Find non-foreign key base table columns that have the same name but a different set of check constraints. The use of constraints should be consistent and all the necessary constraints must be enforced. "If you do something a certain way, do all similar things in the same way." (Robert C. Martin, Clean Code) | Problem detection | INFORMATION_SCHEMA+system catalog base tables | 2024-11-24 12:06 | MIT License | |
128 | Perhaps CHECK should be associated with a domain | Find cases where multiple columns with the same domain have exactly the same CHECK constraint that is directly associated with the table. | Problem detection | INFORMATION_SCHEMA+system catalog base tables | 2024-11-23 15:03 | MIT License | |
129 | Incorrect use of non-deterministic functions in CHECK constraints | Do not create a constraint in case of which data that satisfied a constraint c at the registration time suddenly does not satisfy it any more as the time goes by. Find all the check constraints that use non-deterministic functions (now, current_timestamp, localtimestamp, current_date, current_time) in a way that makes this situation possible. Fort instance, localtimestamp(0)>end_date is an example of such constraint. | Problem detection | INFORMATION_SCHEMA only | 2024-11-22 15:29 | MIT License | |
130 | Duplicate domains | Find domains that have the same properties (base type, character length, not null + check constraints, default value, collation). There should not be multiple domains that have the same properties. Do remember that the same task can be solved in SQL usually in multiple different ways. Therefore, the domains may have syntactically different check constraints that solve the same task. Thus, the exact copies are not the only possible duplication. | Problem detection | INFORMATION_SCHEMA only | 2024-11-21 15:14 | MIT License | |
131 | Sometimes current_timestamp, sometimes now() | Find as to whether you sometimes use current_timestamp function and sometimes now() function. These implement the same functionality. | Problem detection | INFORMATION_SCHEMA+system catalog base tables | 2024-11-21 13:20 | MIT License | |
132 | Sometimes extract, sometimes date_part | Find as to whether you sometimes use date_part function and sometimes extract function. These implement the same functionality. | Problem detection | INFORMATION_SCHEMA+system catalog base tables | 2024-11-21 13:18 | MIT License | |
133 | Sometimes regexp_like, sometimes ~ | Find as to whether you sometimes use regexp_like function and sometimes ~ operator. These implement the same functionality. regexp_like function that was added to PostgreSQL 15 and provides the same functionality as ~ and ~* operators. Try to be consistent. | Problem detection | INFORMATION_SCHEMA+system catalog base tables | 2024-11-21 12:36 | MIT License | |
134 | Index FILLFACTOR is not default | Find all indexes where FILLFACTOR is not default, i.e., it has been changed. The default is different in case of different index types is different. In case of B-tree indexes the default is 90. | General | system catalog base tables only | 2024-11-21 09:28 | MIT License | |
135 | FILLFACTOR is probably too big | Find base tables in case of which the FILLFACTOR property has perhaps a too big value. Try to find base tables that probably encounter UPDATE operations. In the tables that have frequent updates you want to have free space in table pages (blocks) to accommodate new row versions, which the system automatically creates as a result of fulfilling UPDATE statements. If a new row version will be put to another page by the system, then it means that table indexes have to be updated as well. Thus, the more there are indexes, the more the table would benefit from keeping a new row version in the same page as the old version. | Problem detection | INFORMATION_SCHEMA+system catalog base tables | 2024-11-21 09:19 | MIT License | |
136 | Inconsistent referencing to character classes (shorthand vs long name) (2) | Find as to whether different syntaxes (e.g., \w vs [[:alnum:]]) are used to refer to alphanumeric characters within the database. | Problem detection | INFORMATION_SCHEMA+system catalog base tables | 2024-11-19 11:32 | MIT License | |
137 | Inconsistent referencing to character classes (shorthand vs long name) | Find as to whether different syntaxes (e.g., \s vs [[:space:]]) are used to refer to character classes within the same database. | Problem detection | INFORMATION_SCHEMA+system catalog base tables | 2024-11-19 11:24 | MIT License | |
138 | Storing a duration as time | Find columns of base and foreign tables that based on the column names are used to register durations but the type of the column is time. "It is possible to use a TIME data type if the duration is less than 24 hours, but this is not what the type is intended for, and can be the cause of confusion for the next person who has to maintain your code." | Problem detection | INFORMATION_SCHEMA only | 2024-11-06 10:46 | MIT License | |
139 | Storing a duration rather than a point in time | Find columns of base and foreign tables that based on the column names and types are used to register start time and duration rather than start time and end time. | Problem detection | INFORMATION_SCHEMA only | 2024-11-06 09:59 | MIT License | |
140 | Do not register age as a number | Find columns of base and foreign tables that based on the column name and type are used to register age. | Problem detection | INFORMATION_SCHEMA only | 2024-11-06 09:55 | MIT License |