Seq nr | Name | Goal | Type | Data source | Last update▼ | License | ... |
---|---|---|---|---|---|---|---|
141 | Perhaps is not snake_case - id, code, key, or nr is not followed by an underscore | Find names that perhaps do not use the snake_case naming style because the name starts with the phrase "id", "uuid", "code" , "kood", "key", or "nr" that is not followed by an underscore. Prefer snake_case over PascalCase and camelCase in names. | Problem detection | INFORMATION_SCHEMA+system catalog base tables | 2023-11-15 17:19 | MIT License | |
142 | Potentially missing default values of base table columns | Find columns of base tables without a default value that are either Boolean columns that based on the name seem to implement a state machine or temporal columns that based on the name seem to keep registration or update time. These columns often have a default value. | Problem detection | INFORMATION_SCHEMA only | 2023-11-15 17:03 | MIT License | |
143 | Check as to wheteher the names of parameters are in the plural or in the singular form (Estonian version) | Check as to wheteher the names of routine parameters are in the plural or in the singular form. Make sure that you are consistent in naming. | General | INFORMATION_SCHEMA+system catalog base tables | 2023-11-15 16:53 | MIT License | |
144 | Perhaps too many square brackets | Character classes are surrounded by two pairs of square brackets. | Problem detection | INFORMATION_SCHEMA+system catalog base tables | 2023-11-15 10:47 | MIT License | |
145 | Non-predefined character classes must not be between double square brackets | Write correct regular expressions. For instance, if there is a rule that code must consist of one or more digits, then correct expression is code~'^[0-9]+$', not code~'^[[0-9]]+$'. | Problem detection | INFORMATION_SCHEMA+system catalog base tables | 2023-11-13 12:32 | MIT License | |
146 | Views with security invoker | Find views that have the security invoker option. Such option is possible starting from PostgreSQL 15. In case of using such views one cannot create a system where data is accessed through views and the users (applications) do not have direct access to the base tables. | Problem detection | system catalog base tables only | 2023-11-13 12:20 | MIT License | |
147 | Base table column of surrogate key values does not have an integer data type (based on column names) | Find base table columns that belong to a primary key, unique, or foreign key constraint and that name refers to the possibility that these are used to hold surrogate key values. Find the columns where the data type of the column is not an integer type or uuid. | Problem detection | INFORMATION_SCHEMA+system catalog base tables | 2023-11-13 12:10 | MIT License | |
148 | Unsecure SECURITY DEFINER routines | SECURITY DEFINER routines must be secured against the malicious use of pg_temp schema. Find routines that do not explicitly set the search path or do it incorrectly (the search path is between quotation marks) and are thus potential targets of the attack. pg_temp must be the last entry in search_path. The lack of search_path is allowed only if the SQL statements in routines explicitly refer to the schemas that contain the schema objects. | Problem detection | INFORMATION_SCHEMA+system catalog base tables | 2023-11-13 12:07 | MIT License | |
149 | Incorrect check of NULLs | Find the use of =NULL and <>NULL in case of table level check constraints, domain level check constraints, WHEN clauses of triggers, WHERE clauses of rules, subqueries of derived tables, and bodies of routines. Write correct code. In order to determine as to whether a value is missing or not one has to use the IS [NOT] NULL predicate. NULL is the marker in SQL that denotes a missing value. Although it is often called "NULL value", one cannot treat it as an ordinary value, i.e., use it in comparisons as a value. | Problem detection | INFORMATION_SCHEMA+system catalog base tables | 2023-11-12 12:10 | MIT License | |
150 | 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 | 2023-11-12 11:52 | MIT License | |
151 | Candidate keys where all columns have a static default value | Find base table primary key and unique constraints where all columns probably have a static default value. Candidate key columns (columns that belong to the primary key or to an unique constraints) shouldn't have static default values unless you are enforcing a rule that a table can have at most one row. The point of default values is that system assigns them automatically. There cannot be multiple rows with the same key value. | Problem detection | INFORMATION_SCHEMA+system catalog base tables | 2023-11-12 11:33 | MIT License | |
152 | Candidate key columns that have a static default value | Find base table columns that are covered by a primary key or a unique constraint and that probably have a static default value. | Problem detection | INFORMATION_SCHEMA+system catalog base tables | 2023-11-12 11:32 | MIT License | |
153 | Perhaps the type of a base table column/domain should be VARCHAR (based on column names) | Find base table columns that have CHAR type, where character maximum length is bigger than 1 and the name of the column does not refer to the possibility that the column holds some kind of codes or flags or hash values. | Problem detection | INFORMATION_SCHEMA only | 2023-11-12 10:48 | MIT License | |
154 | 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 | |
155 | Column names that make joining more difficult (foreign key column name contains the table name) | Find foreign keys where the name of the foreign key column and the corresponding primary key/unique column is different but the difference comes from the fact that the foreign key column name starts or ends with the table name. Simplify writing queries that have to join data from multiple base tables. If the columns that participate in the join condition have the same name, then one can use the USING syntax. | Problem detection | system catalog base tables only | 2023-11-12 10:26 | MIT License | |
156 | Names of database objects that perhaps end with a sequence number | Find the names (identifiers) of user-defined database objects that end with one or more digit. Names should be informative. Duplicates should be avoided. Digits in names are a possible sign of duplication of database objects or unclear names. | Problem detection | INFORMATION_SCHEMA+system catalog base tables | 2023-11-12 10:09 | MIT License | |
157 | Names of database objects that perhaps end with a sequence number (aggregate view) | Find the number of names (identifiers) of user-defined database objects that end with one or more digit. Names should be informative. Duplicates should be avoided. Digits in names are a possible sign of duplication of database objects or unclear names. | Sofware measure | INFORMATION_SCHEMA+system catalog base tables | 2023-11-12 10:06 | MIT License | |
158 | Names of database objects with four or more consecutive identical symbols | Find names of database objects with four or more consecutive identical symbols | Problem detection | INFORMATION_SCHEMA+system catalog base tables | 2023-11-11 19:48 | MIT License | |
159 | Number of tables covered by derived tables | Find the number of base tables, the number of base tables that are referred from at least one derived table (view or materialized view), the number of base tables that are referred from at least one view, and the number of base tables that are referred from at least one materialized view. If the database is used through the public database interface (virtual data layer), then, ideally, each table is referred from the subquery of at least one derived table. | Sofware measure | INFORMATION_SCHEMA+system catalog base tables | 2023-11-11 09:33 | MIT License | |
160 | Coverage by derived tables | Find for each base table the list of derived tables (both views and materialized views) that refer to the base table. If the database is used through the public database interface (virtual data layer), then, ideally, each table is referred from the subquery of at least one derived table. | General | INFORMATION_SCHEMA+system catalog base tables | 2023-11-11 09:31 | MIT License |