| 981 |
Unnecessary domains |
Domain is a reusable artifact. Effort of its creation should be paid off by the advantages that it offers. If a domain is used in case of at most one column of a base table or even if it is used in case of more than one column but it does not specify neither a default value nor a check constraint, then there is no point of creating the domain. |
Problem detection |
INFORMATION_SCHEMA+system catalog base tables |
2025-11-07 10:11 |
MIT License |
View |
| 982 |
Unnecessary privileges to use trigger functions |
A user that corresponds to an application does not have to have privileges to use trigger functions. If it has these, then it violates the principle of least privilege. |
Problem detection |
INFORMATION_SCHEMA+system catalog base tables |
2025-11-07 10:11 |
MIT License |
View |
| 983 |
Unnecessary usage of the numeric type in case of base table columns |
Find base table columns that have type NUMERIC and the scale is 0, i.e., one can record in the column only integer values. Arithmetic operations are slower in case of the numeric type compared to an integer type. Thus, in order to record integer values, one should use columns with the type SMALLINT, INTEGER, or BIGINT instead of NUMERIC(p,0). |
Problem detection |
INFORMATION_SCHEMA only |
2025-11-07 10:11 |
MIT License |
View |
| 984 |
Unnecessary usage privileges of PUBLIC |
PostgreSQL gives by default some privileges to all the present and future database users (PUBLIC). Find usage privileges of collations, domains, foreign data wrappers, foreign servers, and sequences that have been given to PUBLIC. |
Problem detection |
INFORMATION_SCHEMA+system catalog base tables |
2025-11-07 10:11 |
MIT License |
View |
| 985 |
Unnecessary use of gist index type in case of an exclude constraint |
Find exclude constraints that are based on the gist index type although the default b-tree index type would have been enough. |
Problem detection |
system catalog base tables only |
2025-11-07 10:11 |
MIT License |
View |
| 986 |
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 |
2025-11-07 10:11 |
MIT License |
View |
| 987 |
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 |
2025-11-07 10:11 |
MIT License |
View |
| 988 |
Unused domains (for base table columns and parameters) |
Find domains that are not used in case of any base 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 |
2025-11-07 10:11 |
MIT License |
View |
| 989 |
Unused enumerated types (for base table columns, domains, and parameters) |
Find enumerated types that are not used in case of any base table column, domain, 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 |
INFORMATION_SCHEMA+system catalog base tables |
2025-11-07 10:11 |
MIT License |
View |
| 990 |
Unused foreign data wrappers |
Find foreign data wrappers that do not have any associated foreign servers. |
Problem detection |
INFORMATION_SCHEMA only |
2025-11-07 10:11 |
MIT License |
View |
| 991 |
Unused foreign servers |
Find foreign servers that do not have any associated foreign tables. |
Problem detection |
INFORMATION_SCHEMA only |
2025-11-07 10:11 |
MIT License |
View |
| 992 |
Unused indexes |
Find indexes that are not used by the DBMS. Remember that indexes are not a "free lunch" and they slow down the processes of updating data. |
Problem detection |
INFORMATION_SCHEMA+system catalog base tables |
2025-11-07 10:11 |
MIT License |
View |
| 993 |
Unused indexes (2) |
Find indexes that are not used by the DBMS. Remember that indexes are not a "free lunch" and they slow down the processes of updating data. |
Problem detection |
INFORMATION_SCHEMA+system catalog base tables |
2025-11-07 10:11 |
MIT License |
View |
| 994 |
Unused named input parameters |
Find named input parameters that are not referenced in the routine body. All the parameters that are presented in the routine signature declaration must be used in its body. Otherwise these are dead code elements. |
Problem detection |
INFORMATION_SCHEMA+system catalog base tables |
2025-11-07 10:11 |
MIT License |
View |
| 995 |
Unused schemas |
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 |
2025-11-07 10:11 |
MIT License |
View |
| 996 |
Unused trigger functions |
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 |
INFORMATION_SCHEMA+system catalog base tables |
2025-11-07 10:11 |
MIT License |
View |
| 997 |
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 |
2025-11-07 10:11 |
MIT License |
View |
| 998 |
UPDATE triggers |
Find all UPDATE triggers. Make sure that they specify a correct set of columns in which data modification will fire the trigger. |
General |
INFORMATION_SCHEMA only |
2025-11-07 10:11 |
MIT License |
View |
| 999 |
UPDATE triggers where updated columns have not been specified (the trigger could executed too often) |
Find UPDATE triggers where updated columns are not specified. These triggers could be executed too often because unneeded executions are not prevented. |
Problem detection |
INFORMATION_SCHEMA only |
2025-11-07 10:11 |
MIT License |
View |
| 1000 |
UPDATE triggers where WHEN clause has not been specified (the trigger could executed too often) |
Find UPDATE triggers where WHEN clause is not specified. These triggers could be executed too often because unneeded executions are not prevented. |
Problem detection |
INFORMATION_SCHEMA only |
2025-11-07 10:11 |
MIT License |
View |