Seq nr | Name | Goal▲ | Type | Data source | Last update | License | ... |
---|---|---|---|---|---|---|---|
821 | Potentially missing PRIMARY KEY or UNIQUE constraints (based on UUIDs) | If something has to be unique, then it must be said to the system so that it could use the information for internal optimizations and enforce the constraint. Find columns that contain Universally Unique Identifiers but are not a part of any simple PRIMARY KEY/UNIQUE constraint and are also not part of a foreign key. | Problem detection | INFORMATION_SCHEMA+system catalog base tables | 2022-11-03 11:18 | MIT License | |
822 | Incorrect prefix of a constraint name or an index name | If the name of an object has the prefix that refers to the type of the object (for instance, primary key constraint or foreign key constraint), then you should use references to the correct object type. Find prefixes of constraint names and index names that incorrectly refer to the type of the object. For instance, incorrect would be to use chk_ as the prefix of an index name or pk_ as the prefix of a check constraint name. | Problem detection | INFORMATION_SCHEMA+system catalog base tables | 2021-11-18 21:08 | MIT License | |
823 | Incorrect suffix of a constraint name or an index name | If the name of an object has the suffix that refers to the type of the object (for instance, primary key constraint or foreign key constraint), then you should use references to the correct object type. Find suffixes of constraint names and index names that incorrectly refer to the type of the object. For instance, incorrect would be to use _chk as the suffix of an index name or _pk as the suffix of a check constraint name. | Problem detection | INFORMATION_SCHEMA+system catalog base tables | 2021-02-25 17:29 | MIT License | |
824 | Parameter name is the same as the name of a used column | If the name of a routine parameter and the name of a column of a table that is used in the routine are the same, then it makes it more difficult to understand the code. | Problem detection | INFORMATION_SCHEMA+system catalog base tables | 2023-01-20 13:54 | MIT License | |
825 | Parameter name is the same as the name of a used column (ver 2) | If the name of a routine parameter and the name of a column of a table that is used in the routine are the same, then it makes it more difficult to understand the code. | Problem detection | INFORMATION_SCHEMA+system catalog base tables | 2023-01-20 13:54 | MIT License | |
826 | Privileges to use base table columns | If you do give privileges to base tables, then these should follow the principle of least privilege - the smallest possible amount of privileges to the smallest possible set of columns | General | INFORMATION_SCHEMA+system catalog base tables | 2020-12-29 10:38 | MIT License | |
827 | No point to have in a procedure COMMIT without ROLLBACK or vice versa | If you end transaction in a procedure, then there should be a possibility to either commit or rollback the transaction based on some condition. Procedures appeared in PostgreSQL 11. | Problem detection | INFORMATION_SCHEMA+system catalog base tables | 2021-11-04 12:00 | MIT License | |
828 | CHECK constraints on columns with temporal data | If your table contains columns with temporal data, then it will be appropriate to restrict the range of possible values in these columns because some of the values that belong to the type might not be appropriate (for instance, imagine a client who was born in 1100-12-03 or a contract that was registered in 3890-12-12- 12:45). If your table contains multiple columns with temporal data that denote events, then the rule about the order of the events must be enforced, if possible. | General | INFORMATION_SCHEMA only | 2023-12-25 12:37 | MIT License | |
829 | FOR UPDATE is not allowed with aggregate functions | Implement explicit locking correctly. Instead of writing, for instance, SELECT Count(*) AS cnt FROM person WHERE person_id=1 FOR UPDATE; one has to write SELECT person_id FROM person WHERE person_id=1 FOR UPDATE; | Problem detection | INFORMATION_SCHEMA+system catalog base tables | 2021-11-04 11:23 | MIT License | |
830 | Names of database objects that contain two or more consecutive underscores or spaces as separators of name components | Improve the readability of names. Find the names (identifiers) of user-defined database objects that contain two or more consecutive underscores or spaces that separate name components, i.e., these are not at the beginning and in the end of the name. Example of such names are person__id or "person id". Names with duplicate underscores use snake case style but duplication of underscores does not improve the usability of the name. | Problem detection | INFORMATION_SCHEMA+system catalog base tables | 2023-03-18 16:48 | MIT License | |
831 | Names of database objects that start with an underscore | Improve the readability of names. Find the names (identifiers) of user-defined database objects that start with an underscore. This is not necessarily a mistake. For instance, parameter names could start with an underscore. On the other hand, it could be that the prefix is missing in the name. | General | INFORMATION_SCHEMA+system catalog base tables | 2023-03-18 16:49 | MIT License | |
832 | The usage of double vs singular underscores or spaces in names as separator of name components | Improve the readability of names. Find the number of names (identifiers) of user-defined database objects that contain two or more consecutive underscores or spaces as the separator of name components vs. the number of names that contain a single underscore or space to separate name components. Try to be consistent in the usage of underscores. | Sofware measure | INFORMATION_SCHEMA+system catalog base tables | 2023-03-17 11:11 | MIT License | |
833 | Inconsistent chain of relationships in terms of using ON UPDATE CASCADE | 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 CASCADE should be consistent - either all the involved foreign keys have ON UPDATE CASCADE compensating action or none of these have it. 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 | 2021-02-25 17:30 | MIT License | |
834 | JSON type instead of JSONB type | "In general, most applications should prefer to store JSON data as jsonb, unless there are quite specialized needs, such as legacy assumptions about ordering of object keys." (https://www.postgresql.org/docs/current/datatype-json.html) | Problem detection | INFORMATION_SCHEMA only | 2021-02-25 17:30 | MIT License | |
835 | Initially deferred constraint triggers with unnecessary locking | Initially deferred constraint triggers do not need explicit statements for locking tables or rows. | Problem detection | INFORMATION_SCHEMA+system catalog base tables | 2021-10-08 11:25 | MIT License | |
836 | Routines with INSERT statements that are sensitive towards the order of columns | INSERT statements shouldn't be sensitive towards the order of columns. If one changes the order of columns in a table then these statements must be rewritten. Otherwise the code will not work or works incorrectly. | Problem detection | INFORMATION_SCHEMA+system catalog base tables | 2021-11-04 16:15 | MIT License | |
837 | Primary key columns are not the first in a table | In SQL tables each column has the ordinal position. Find all the base tables where the primary key columns are not the first in the table, i.e., there is at least one non-primary key column that comes before a primary key column. It is easier to grasp the primary key if its columns are the first in the table. It could be that a table inherits from an abstract table where no keys have been defined. | Problem detection | INFORMATION_SCHEMA+system catalog base tables | 2021-10-16 10:33 | MIT License | |
838 | Routine body has keywords that are not in uppercase | Keywords in uppercase improve readability. | Problem detection | INFORMATION_SCHEMA+system catalog base tables | 2023-12-24 17:06 | MIT License | |
839 | Extension routines that execution privilege has been granted to PUBLIC | Know the privileges that users have in your system. Probably all the database users do not need these privileges. | Problem detection | INFORMATION_SCHEMA+system catalog base tables | 2021-02-25 17:30 | MIT License | |
840 | AND takes precedence over OR | Make sure that Boolean expressions take into account precedence rules of Boolean operators. AND operator has precedence over OR operator. | General | INFORMATION_SCHEMA+system catalog base tables | 2020-11-06 14:51 | MIT License |