Seq nr | Name | Goal▲ | Type | Data source | Last update | License | ... |
---|---|---|---|---|---|---|---|
881 | A large number of triggers | Show user-defined triggers if there are more than 9 different trigger routine bodies, i.e., different triggers on different tables that do the same thing count as one trigger. | General | INFORMATION_SCHEMA+system catalog base tables | 2023-12-25 11:23 | MIT License | |
882 | Perhaps the type of a base table column/domain should be numeric (based on default values) | Specify for each column/domain a right data type that takes into account expected values in the column/domain. Find base table columns and domains that have a textual type but the default value that represents a number (for instance, '100', '2', or '0.22'). Exclude columns about formats. | Problem detection | INFORMATION_SCHEMA only | 2023-12-30 10:59 | MIT License | |
883 | Perhaps the type of a base table column/domain should be INTEGER/SMALLINT/BIGINT (based on sequence generators) | Specify for each column/domain a right data type that takes into account expected values in the column/domain. Find base table columns and domains that refer to the nextval function by using the default value mechanism but do not have the type INTEGER, SMALLINT, or BIGINT. This check is performed in case of identity columns: ERROR: identity column type must be smallint, integer, or bigint. | Problem detection | INFORMATION_SCHEMA only | 2021-03-04 11:24 | MIT License | |
884 | Do not clone columns | "Split a base table column into multiple columns based on the values in some other column. Each such newly created column has the name, a part of which is a data value from the original tables."(Bill Karwin) Find base tables that have more than one columns with the same type and field size and the difference between the columns are the year or month number at the end of the column name (two or four numbers, preceded by an underscore). | Problem detection | INFORMATION_SCHEMA only | 2022-11-28 15:15 | MIT License | |
885 | CHECK constraints that perhaps incorrectly consider 'infinity' and '-infinity' special values | Such special values belong to the types DATE, TIMESTAMP, NUMERIC, REAL, and DOUBLE PRECISION. No value can be bigger than infinity or smaller than -infinity. If the check constraint cheks that a value must be bigger than -infinity or smaller than infinity, then it does not restrict (almost) anything. | Problem detection | INFORMATION_SCHEMA+system catalog base tables | 2022-12-07 20:13 | MIT License | |
886 | ROW-level BEFORE and INSTEAD OF triggers with RETURN NULL | Such triggers effectively cancel data modification. It might be correct but could also be a mistake. "Row-level triggers fired BEFORE can return null to signal the trigger manager to skip the rest of the operation for this row (i.e., subsequent triggers are not fired, and the INSERT/UPDATE/DELETE does not occur for this row). " (PostgreSQL documentation) "INSTEAD OF triggers (which are always row-level triggers, and may only be used on views) can return null to signal that they did not perform any updates, and that the rest of the operation for this row should be skipped (i.e., subsequent triggers are not fired, and the row is not counted in the rows-affected status for the surrounding INSERT/UPDATE/DELETE). " (PostgreSQL documentation) | Problem detection | INFORMATION_SCHEMA+system catalog base tables | 2021-02-25 17:30 | MIT License | |
887 | Table columns that are associated with a sequence generator | Surrogate key values must be generated by using the system (the sequence generator mechanism in case of PostgreSQL). If there is no usage of sequence generators, then there is a question as to whether there are no surrogate keys in the database at all (could be possible and OK) or (more probable) developers have forgotten to implement the generation of surrogate keys. | General | INFORMATION_SCHEMA only | 2021-03-07 21:06 | MIT License | |
888 | Base table columns with the type VARCHAR(1) | The choice of data types should reveal as much as possible about the nature of the data in the column. The type of these columns could be CHAR(1) and they should have a constraint that a value in the column cannot be an empty string. | Problem detection | INFORMATION_SCHEMA only | 2021-02-25 17:29 | MIT License | |
889 | Columns with exact/floating numeric types have textual default values | The default value of a column should belong to the type of the column. The system shouldn't conduct unnecessary type casts. | Problem detection | INFORMATION_SCHEMA only | 2021-02-25 17:29 | MIT License | |
890 | 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 | |
891 | Names of triggers and rules that do contain the table name | The names should contain table name in order to make the names better understandable. | General | INFORMATION_SCHEMA+system catalog base tables | 2023-01-13 19:23 | MIT License | |
892 | Names of triggers and rules that do not contain the table name | The names should contain table name in order to make the names better understandable. | Problem detection | INFORMATION_SCHEMA+system catalog base tables | 2023-01-13 19:18 | MIT License | |
893 | Different prefixes of a candidate key column and a referencing foreign key column | The naming must be consistent. Find foreign key constraints where the candidate key column and foreign key column names have different prefixes. Thus, for instance, one cannot use USING syntax for joining the tables. | Problem detection | system catalog base tables only | 2021-02-25 17:29 | MIT License | |
894 | Different suffixes of a candidate key column and a referencing foreign key column | The naming must be consistent. Find foreign key constraints where the candidate key column and foreign key column names have different suffixes. Thus, for instance, one cannot use USING syntax for joining the tables. | Problem detection | system catalog base tables only | 2021-02-25 17:29 | MIT License | |
895 | Names of columns with the type BOOLEAN | The naming of BOOLEAN columns must be consistent. For the better readability the names of such columns could have prefix "is_" (in English) or "on_" (in Estonian) | General | INFORMATION_SCHEMA+system catalog base tables | 2024-01-03 09:41 | MIT License | |
896 | Columns with BOOLEAN type that do not have a good name | The phrase "is_" or "has_" or "can_" (in English) or "on_" (in Estonian) should be used in the name - preferably in the beginning. Worse: agreed, kinnitatud. Better: contract_is_agreed, leping_on_kinnitatud. Perhaps the best: is_contract_agreed or is_agreement, on_leping_kinnitatud, on_kinnitatud. | Problem detection | INFORMATION_SCHEMA+system catalog base tables | 2024-01-03 09:56 | MIT License | |
897 | Cannot accommodate all the fractional seconds in case of table columns | The precision of a timestamp type of a column must be able to accommodate all the fractional seconds of the default value of the column. Find table columns with the type timestamp without time zone(m) or timestamp with time zone(m) that have a default value LOCALTIMESTAMP(n) or CURRENT_TIMESTAMP(n) WHERE n>m. | Problem detection | INFORMATION_SCHEMA only | 2021-02-25 17:30 | MIT License | |
898 | Columns with BOOLEAN type that do have a good name | The prefic of the name should be "is_" or "has_" or "can_" (in English) or "on_" (in Estonian). Worse: agreed, kinnitatud. Better: is_agreement, on_kinnitatud. | General | INFORMATION_SCHEMA+system catalog base tables | 2024-01-03 09:56 | MIT License | |
899 | 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-01-13 20:41 | MIT License | |
900 | Insufficient number of user-defined non-trigger routines | There must be at least n (four in this case) user-defined non-trigger routines in the database. | Problem detection | INFORMATION_SCHEMA+system catalog base tables | 2021-02-25 17:30 | MIT License |