Seq nr | Name▲ | Goal | Type | Data source | Last update | License | ... |
---|---|---|---|---|---|---|---|
601 | Perhaps a CHECK constraint about the order of events is missing | Find base tables that have at least two columns that have DATE or TIMESTAMP (with or without time zone) type and do not have any associated CHECK constraint that involves two or more of these columns. The columns mean that we want to record data about events or processes, which often have a certain order. Hence, in case of each row of such a table the values in these columns must be in a certain order. For instance, the end of a meeting cannot be earlier than the beginning of the meeting. | Problem detection | INFORMATION_SCHEMA+system catalog base tables | 2021-02-25 17:29 | MIT License | |
602 | Perhaps an existing domain could be used to define the properties of a base table column? | Find non-foreifgn key base table columns that have not been defined based on a domain but that have the same properties (data type, field size, default value, and pemisson to use NULLs) as some domain. If you define a domain, then you should try to use it in case of multiple columns. | Problem detection | INFORMATION_SCHEMA+system catalog base tables | 2021-02-25 17:29 | MIT License | |
603 | Perhaps an inconsistent use of NO ACTION and RESTRICT in the foreign key declarations | Find as to whether in case of foreign key constraints both the compensating actions RESTRICT and NO ACTION are used within the same database. If the same thing has to do in different places, then try to do it in the same way. | Problem detection | system catalog base tables only | 2021-02-25 17:29 | MIT License | |
604 | Perhaps an overcomplicated constraint expression that compares the result of a Boolean expression with a Boolean value | Find table and domain CHECK constraints that compare the result of a Boolean expression with a Boolean value. If you can choose between two logically equivalent Boolean expressions choose the more simple expression. | Problem detection | INFORMATION_SCHEMA+system catalog base tables | 2023-12-30 11:57 | MIT License | |
605 | Perhaps an unnecessary default value (the empty string or a string that consists of only whitespace) of a base table column/domain | Find table columns and domains with the default value that is the empty string or a string that consists of only whitespace (for instance, newlines, spaces). | Problem detection | INFORMATION_SCHEMA only | 2021-03-20 11:42 | MIT License | |
606 | Perhaps an unsuitable use of CHAR(n) type in base tables | Find non-foreign key base table columns with the type CHAR(n) where n>1 that are not meant for storing codes or hash values. CHAR(n) is suitable for storing values that have a fixed length (for instance, country code according to the ISO standard). In case of variable length strings the end of the stored string is padded with spaces. Thus, for instance, do not use CHAR(n) in case of columns for storing names, comments, descriptions, e-mail addresses etc. Hash values have a fixed length that depends on the used hash function. | Problem detection | INFORMATION_SCHEMA+system catalog base tables | 2023-11-12 10:46 | MIT License | |
607 | Perhaps a redundant column (based on sequence generators) | Find base tables where more than one column gets the default value by using the sequence generator mechanism. | Problem detection | INFORMATION_SCHEMA only | 2021-03-05 09:42 | MIT License | |
608 | Perhaps a reference to the variable NEW is missing | Find row level before insert and before update triggers that only task is not to raise an exception and where the variable NEW is not used in the trigger routine outside the RETURN clause. | Problem detection | INFORMATION_SCHEMA+system catalog base tables | 2023-12-21 20:34 | MIT License | |
609 | Perhaps a reference to the variable OLD is missing | Find row level before delete triggers that only task is not to raise an exception and where the variable OLD is not used in the trigger routine outside the RETURN clause. | Problem detection | INFORMATION_SCHEMA+system catalog base tables | 2023-12-21 19:29 | MIT License | |
610 | Perhaps a regular expression could be simplified | Find regular expressions that name character classes a-zA-Z. | Problem detection | INFORMATION_SCHEMA+system catalog base tables | 2021-11-04 16:19 | MIT License | |
611 | Perhaps a relationship should be irreflexive | Enforce all the constraints. A binary relation is called irreflexive, if it does not relate any element to itself. | Problem detection | system catalog base tables only | 2021-02-25 17:29 | MIT License | |
612 | Perhaps a routine does not have a real task | Find the routines where the only action is to return an argument value, a constant value, NULL or return the value of OLD or NEW variable in case of trigger functions. | Problem detection | INFORMATION_SCHEMA+system catalog base tables | 2021-11-05 12:09 | MIT License | |
613 | Perhaps a state machine is implemented with Boolean columns | Find implementations of state machines that uses a set of one or more Boolean columns. These columns could have the type Boolean or could probably (based on the column name and non-participation in a foreign key) contain values that represent truth values. | Problem detection | INFORMATION_SCHEMA+system catalog base tables | 2023-11-09 13:22 | MIT License | |
614 | Perhaps a state machine is implemented with timestamp columns | Find implementations of state machines that uses a set of columns with a timestamp type. | Problem detection | INFORMATION_SCHEMA only | 2021-03-26 21:04 | MIT License | |
615 | Perhaps a too generic foreign key column name | Find the names of foreign key columns that are too generic. The expressive names of table columns allow database users better and more quickly understand the meaning of data in the database. A person could participate in a process or be associated with an object due to different reasons. Thus, foreign key column names like isik_id, person_id, tootaja_id, worker_id etc. are too generic. The name should refer (also) to the reason why the person is connected. | Problem detection | system catalog base tables only | 2023-03-15 18:27 | MIT License | |
616 | Perhaps a too long name, which has been automatically shortened | Find names (identifiers) of user-defined database objects that are 63 bytes long. This is the longest permitted length of identifiers if the default value of the NAMEDATALEN parameter has not been changed. PostgreSQL shortens too long identifiers automatically. Automatic code modification could break it somewhere. | Problem detection | INFORMATION_SCHEMA+system catalog base tables | 2024-12-21 16:46 | MIT License | |
617 | 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 | |
618 | Perhaps a too long SQL routine | A large routine may have multiple tasks that should be split between multiple routines that have a more focused task. Find the SQL routines where the number of statements (logical lines of code) is bigger than 5. | Problem detection | INFORMATION_SCHEMA+system catalog base tables | 2024-01-04 16:39 | MIT License | |
619 | Perhaps a too simplified state machine | Find base table columns with Boolean type that name refers to the possibility that these are used to register as to whether an entity is currently in active state or not. Find the base tables that have exactly one Boolean column. During the system design one should find all the possible states of an entity type that influence the behavior of the information system. Data as to whether an entity is in one of these states should be in the database. Having only two states - active/inactive - is sometimes a too big simplification. | Problem detection | INFORMATION_SCHEMA only | 2021-03-27 03:08 | MIT License | |
620 | Perhaps a unneccessary surrogate key | Find base tables that have the primary key that is not a surrogate key and an alternate key that is a surrogate key. Perhaps the surrogate key column is not needed. | Problem detection | INFORMATION_SCHEMA+system catalog base tables | 2021-03-07 20:59 | MIT License |