# | Name | Goal | Type | Data source | Last update ▼ | License | |
---|---|---|---|---|---|---|---|
121 | Perhaps a CHECK constraint about required personal name components is missing | Find base tables that have optional columns for recording both given name and surname and do not have a CHECK constraint that requires that at least one of the name components must be registered in case of each person. | Problem detection | INFORMATION_SCHEMA+system catalog base tables | 2024-12-11 12:23 | MIT License | View |
122 | Very similar (but not equal) routine names | Find pairs of names of different types of routines that are very similar but not equal. | Problem detection | INFORMATION_SCHEMA+system catalog base tables | 2024-11-30 12:09 | MIT License | View |
123 | Very similar domain names | Find pairs of names of domains that are very similar or even equal. | Problem detection | INFORMATION_SCHEMA only | 2024-11-30 12:07 | MIT License | View |
124 | Very similar table names | Find pairs of names of different types of tables that are very similar or even equal. | Problem detection | INFORMATION_SCHEMA+system catalog base tables | 2024-11-30 11:50 | MIT License | View |
125 | 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 | 2024-11-30 10:46 | MIT License | View |
126 | SQL functions that use optimistic approach for locking but do not return a value | Find SQL functions that use a hidden column of PostgreSQL tables - xmin - to implement optimistic locking but do not return any information to the invoker of the functions, i.e., whether the update/delete operation succeeded or not. The functions should let their invokers know as to whether the function succeeded in updating or deleting a row. | Problem detection | INFORMATION_SCHEMA+system catalog base tables | 2024-11-30 10:02 | MIT License | View |
127 | CHECK constraints are inconsistent with DEFAULT values | Find table CHECK constraints that involve two columns that have the same default value. However the constraint assumes that the values must be unequal or one value must be bigger than another. | Problem detection | INFORMATION_SCHEMA+system catalog base tables | 2024-11-30 09:58 | MIT License | View |
128 | 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 | View |
129 | 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 | View |
130 | 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 | View |
131 | 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 | View |
132 | 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 | View |
133 | 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 | View |
134 | 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 | View |
135 | 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 | View |
136 | 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 | View |
137 | 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 | View |
138 | 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 | View |
139 | 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 | View |
140 | 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 | View |