Seq nr | Name | Goal | Type | Data source▲ | Last update | License | ... |
---|---|---|---|---|---|---|---|
541 | Perhaps a CHECK constraint about the combination of truth values is missing | Find base tables that have at least two columns that have Boolean type and have at least one Boolean column that is not covered by a CHECK constraint involving more than one Boolean column. The Boolean columns possibly mean that we want to record data about states. Often the states depend on each other. For instance, if an order is archived it must be inactive. | Problem detection | INFORMATION_SCHEMA+system catalog base tables | 2021-02-25 17:29 | MIT License | |
542 | 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 | |
543 | 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 | |
544 | 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 | |
545 | 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 | |
546 | 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 | |
547 | 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 | |
548 | 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 | |
549 | 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 | |
550 | 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 | |
551 | 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 | 2023-03-17 10:05 | MIT License | |
552 | 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 20. | Problem detection | INFORMATION_SCHEMA+system catalog base tables | 2024-01-04 16:38 | MIT License | |
553 | 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 | |
554 | 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 | |
555 | Perhaps brackets are missing in a regular expression that uses OR logical operation | Find regular expressions where choice between alternatives has no brackets. Thus, instead of '(a|b|c)' there is 'a|b|c'. An example: '^a|b|c$' -permits in the string symbol "|" but '^(a|b|c)$' does not permit in the string symbol "|". | Problem detection | INFORMATION_SCHEMA+system catalog base tables | 2023-11-09 20:22 | MIT License | |
556 | Perhaps check constraint names contain incorrect or unnecessary words | Find names of check constraints (either associated with a base table or a domain) that names contain words that are not needed in the name. For instance, constraints cannot ensure the correctness of data and thus the word correct should not be used in the names. Words like "valid" or phrases like "follows_rules" are just noise because all the constraint ensure that the registered data values are valid and follow certain rules. | Problem detection | INFORMATION_SCHEMA+system catalog base tables | 2023-10-06 14:10 | MIT License | |
557 | Perhaps Count(*) is wrongly used | Find user-defined routines and derived tables (views/materialized views) that have a subquery that invokes Count aggregate function like this - Count(*), uses outer join, and grouping. In case of grouping you do not want to get an answer that an empty group contains one member. | Problem detection | INFORMATION_SCHEMA+system catalog base tables | 2021-10-25 16:40 | MIT License | |
558 | Perhaps duplicate check of empty strings (ver 2) | Find columns that have a check that prevents the empty string in the column but there is already another check on the column that enforces the constraint. | Problem detection | INFORMATION_SCHEMA+system catalog base tables | 2021-12-20 11:30 | MIT License | |
559 | Perhaps excessive privileges to use base tables | Find excessive privileges to use base tabes (for others than the owner of the base table). The excessive privileges are all that are not SELECT, INSERT, UPDATE, DELETE. | Problem detection | INFORMATION_SCHEMA+system catalog base tables | 2021-02-25 17:29 | MIT License | |
560 | Perhaps excessive privileges to use views | Find non-SELECT privileges to use views (for others than the owner of the view). Perhaps there should be only the privilege to make queries (SELECT statements based on the views) and data modification takes place by using routines. REFERENCES and TRIGGER privileges are definitely not needed. | Problem detection | INFORMATION_SCHEMA+system catalog base tables | 2021-02-25 17:29 | MIT License |