Seq nr | Name | Goal▲ | Type | Data source | Last update | License | ... |
---|---|---|---|---|---|---|---|
741 | Triggers that are used to calculate tsvector values react to a wrong set of events | Find triggers on base tables that are used to calculate tsvector values that react to a wrong set of events, i.e., react to the DELETE event or do not react to the INSERT and UPDATE events. | Problem detection | system catalog base tables only | 2023-11-07 10:14 | MIT License | |
742 | Triggers with arguments from the CREATE TRIGGER statement | Find triggers that get an argument from the CREATE TRIGGER statement. | General | INFORMATION_SCHEMA+system catalog base tables | 2023-12-22 12:35 | MIT License | |
743 | Update prevention may prevent legal updates | Find triggers that try prevent updating data in a certain column but prevent also certain legal updates - updates that write to a field a value that was in the field before the update. | Problem detection | INFORMATION_SCHEMA+system catalog base tables | 2022-07-07 13:12 | MIT License | |
744 | Too generic names (unique indexes) | Find unique indexes that have too generic names like "key" or the name contain too generic words like "data" (all constraints restrict data in the table), or the name is an abbreviation of a constraint type name. | Problem detection | system catalog base tables only | 2023-01-08 10:38 | MIT License | |
745 | Too generic names (unique index columns) | Find unique index (not associated with a constraint) columns with the names like id, identifikaator, code, kood, number, etc. The names could have underscores as the prefix or suffix. These are too generic names. | Problem detection | system catalog base tables only | 2023-01-07 20:34 | MIT License | |
746 | Unlogged tables | Find unlogged tables. These may improve the performance of INSERT operations, but with the price of possibly loosing data - an unlogged table is automatically truncated after a crash or unclean shutdown. | General | system catalog base tables only | 2020-11-06 14:51 | MIT License | |
747 | Unnamed parameters | Find unnamed parameters in PL/PGSQL routines that do not declare aliases for parameters and in SQL routines. Avoid unnamed parameters because dependency on position in case of referencing the parameters makes evolving the code more difficult. In case of unnamed parameters - if one changes the order of parameters in the routine signature, then one has to change the body of the routine in order to use correct references. The bigger is the number of parameters in a routine the more the unnamed parameters make it more difficult to understand the routine. | Problem detection | INFORMATION_SCHEMA+system catalog base tables | 2023-03-15 18:16 | MIT License | |
748 | Updatable views that do not have WITH CHECK OPTION constraint | Find updatable views that do not have WITH CHECK OPTION constraint. WITH CHECK OPTION constraint prevents updates through the view that violate the predicate of the view. Such updates must be prevented. | Problem detection | INFORMATION_SCHEMA only | 2023-10-29 10:33 | MIT License | |
749 | Views with the WITH LOCAL CHECK OPTION constraint | Find updatable views that have WITH LOCAL CHECK OPTION constraint. The predicate of a view is the conjunction of the predicates of its (directly and indirectly) underlying tables (both base tables and derived tables) as well as the predicate of the view itself. In case of using WITH LOCAL CHECK OPTION constraint "New rows are only checked against the conditions defined directly in the view itself. Any conditions defined on underlying base views are not checked (unless they also specify the CHECK OPTION)." (PostgreSQL manual) Thus, use instead WITH CASCADED CHECK option to instruct the system to check new rows against the entire predicate of the view. | Problem detection | INFORMATION_SCHEMA only | 2021-02-25 17:30 | MIT License | |
750 | Updatable views with WHERE clause that do not have WITH CHECK OPTION constraint | Find updatable views that restrict rows, i.e., have WHERE clause, but do not have WITH CHECK OPTION constraint. WITH CHECK OPTION constraint prevents updates through the view that violate the predicate of the view. Such updates must be prevented. | Problem detection | INFORMATION_SCHEMA only | 2024-01-14 17:11 | MIT License | |
751 | Grantable usage privileges | Find usage privileges that the carrier of the privilege can in turn grant to others, i.e., the privileges have been given WITH GRANT OPTION. The number of privileges that can be passed on should be as small as possible. | Problem detection | INFORMATION_SCHEMA+system catalog base tables | 2024-01-07 13:43 | MIT License | |
752 | Unused composite types (for table columns, typed tables, input and output parameters) | Find user-defined composite types that are not used in case of any table, column, and routine (input or otput) parameter (as their type). Do not keep in your database elements that are not needed by anybody. These should be put in use or dropped, otherwise these are dead code. | Problem detection | system catalog base tables only | 2021-02-25 17:30 | MIT License | |
753 | User-defined non-trigger routines without parameters | Find user-defined non-trigger routines with no parameters. | General | INFORMATION_SCHEMA+system catalog base tables | 2021-11-03 20:05 | MIT License | |
754 | A setter does not update a table | Find user-defined non-trigger SQL and PL/pgSQL routines that name starts with "set" (but not with "setting") but do not contain a UPDATE statement. | Problem detection | INFORMATION_SCHEMA+system catalog base tables | 2022-11-27 18:35 | MIT License | |
755 | The name of the routine does not match with the action of the routine | Find user-defined non-trigger SQL and PL/pgSQL routines where the beginning of the name of the routine indicates a certain action inside the routine (INSERT, UPDATE, or DELETE) but there is no such statement in the routine body. | Problem detection | INFORMATION_SCHEMA+system catalog base tables | 2022-11-19 14:37 | MIT License | |
756 | Coalesce/Concat need at least two arguments | Find user-defined routines and derived tables (views/materialized views) that have a subquery that contain an invocation of Coalesce or Concat function with just one argument. You should use the Coalesce and Concat functions correctly by invoking these with at least two arguments. If one invokes these functions with one argument, then the functions will return the input value. | Problem detection | INFORMATION_SCHEMA+system catalog base tables | 2021-12-08 11:49 | MIT License | |
757 | 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 | |
758 | Perahaps Coalesce invocation is missing or Concat should be used | Find user-defined routines and derived tables (views/materialized views) that have a subquery that invokes || operator but does not use Coalesce function to ensure that the arguments are not NULL. In PostgreSQL expression value || NULL returns NULL. In order to get value as the result, one has to replace NULL with a value (empty string) by using, for instance, Coalesce function (an alternative is to use a CASE expression). Instead of || + Coalesce, one could use Concat, Concat_ws, or Format functions for the concatenation. | Problem detection | INFORMATION_SCHEMA+system catalog base tables | 2021-12-08 11:51 | MIT License | |
759 | A routine is invoked only once | Find user-defined routines that are invoked by exactly one user-defined routine. | Problem detection | INFORMATION_SCHEMA+system catalog base tables | 2023-12-10 17:11 | MIT License | |
760 | The reference to a database operation is missing from a comment | Find user-defined routines that comment does not contain a reference to a database operation that the routine implements. In case of routines that have been created based on the contracts of database operations, one should refer to the short identifier of the operation in the comment of the routine. The operation identifier must be in this case in the form OP | Problem detection | INFORMATION_SCHEMA+system catalog base tables | 2021-11-04 11:39 | MIT License |