Seq nr | Name | Goal | Type | Data source▲ | Last update | License | ... |
---|---|---|---|---|---|---|---|
781 | User-defined routines that use md5 hash for other purposes than generating test data | Find user-defined routines that use md5 hashes for the security purposes. Nowadays such hashes can be calculated too quickly and its use should be avoided at least for hashing passwords. Exclude routines that invoke both md5 function and generate_series function and are thus probably used to generate test data. | Problem detection | INFORMATION_SCHEMA+system catalog base tables | 2021-10-31 15:23 | MIT License | |
782 | User-defined routines that use positional references to parameters | Use parameter names instead of positional references to improve code evolvability. | Problem detection | INFORMATION_SCHEMA+system catalog base tables | 2021-11-05 13:18 | MIT License | |
783 | User-defined routines that use xmin hidden column | Find routines that contain a UPDATE or a DELETE statement that search condition refers to the xmin column. If one uses optimistic approach for dealing with the concurrent modifications of data, then xmin values should be presented by views and used in routines that modify or delete rows. | General | INFORMATION_SCHEMA+system catalog base tables | 2021-11-04 11:30 | MIT License | |
784 | User-defined routines with dynamic SQL | Find routines that use dynamic SQL. Make sure that dynamic SQL is indeed needed, i.e., the task cannot be solved with static SQL. Make sure that the routine is protected against attacks that use SQL injection method. | General | INFORMATION_SCHEMA+system catalog base tables | 2021-11-04 11:09 | MIT License | |
785 | User-defined routines with dynamic SQL that are potential targets of the SQL injection attack | Find routines that have at least one input parameter, use dynamic SQL but do not escape the input arguments at all. | Problem detection | INFORMATION_SCHEMA+system catalog base tables | 2021-11-04 11:58 | MIT License | |
786 | User-defined routines with the same parameters (same name and type) regardless of the order of parameters | Find routines with the same parameters (same name and type) regardless of the order of parameters. Make sure that there is no accidental duplication. The query helps users to group together routines that probably have related tasks. | General | INFORMATION_SCHEMA+system catalog base tables | 2020-11-06 14:51 | MIT License | |
787 | Username is not unique | Find textual columns that potentially contain usernames (including columns that potentially contain e-mail addresses) that do not have a unique constraint or a unique index that involves only this column. | Problem detection | INFORMATION_SCHEMA+system catalog base tables | 2021-02-25 17:29 | MIT License | |
788 | Using AFTER triggers to enforce constraints | Do not let the system to do extra work. Checking a constraint with an AFTER trigger means that the trigger procedure will be executed after the data modification and if the check fails, then the system has to do extra work to roll back the changes. | Problem detection | INFORMATION_SCHEMA+system catalog base tables | 2021-02-25 17:29 | MIT License | |
789 | Using BEFORE triggers to log data changes | Do not let the system to do extra work. Logging changes with a BEFORE trigger means extra work for rolling back the changes in case the logged data modification fails. | Problem detection | INFORMATION_SCHEMA+system catalog base tables | 2021-02-25 17:29 | MIT License | |
790 | Using conditionals to determine the returned value | Use SQL language instead of PL/pgSQL where possible. Instead of using an IF statement, you can check as to whether the data modification succeeded or not by using the RETURNING clause in the data modification statement. | Problem detection | INFORMATION_SCHEMA+system catalog base tables | 2021-11-04 11:52 | MIT License | |
791 | Using in some way reserved (in PostgreSQL) SQL keywords as the names of a database object (aggregate view) | "Names in software are 90 percent of what make software readable. You need to take the time to choose them wisely and keep them relevant. Names are too important to treat carelessly. Names should not cause confusion." (Robert C. Martin, Clean Code) Names should not cause confusion. Find the distinct names (identifiers) of user-defined objects that are SQL keywords that are not completely unreserved in PostgreSQL, i.e., these either never cannot be used as regular identifiers or cannot be used in case of some type of database objects. In PostgreSQL "there are several different classes of tokens ranging from those that can never be used as an identifier to those that have absolutely no special status in the parser as compared to an ordinary identifier. " (PostgreSQL manual) Moreover, such identifiers are often too general, i.e., do not provide enough information about the named object. | Problem detection | INFORMATION_SCHEMA+system catalog base tables | 2024-12-21 17:17 | MIT License | |
792 | Using in some way reserved (in PostgreSQL) SQL keywords as the names of a database object (detailed view) | "Names in software are 90 percent of what make software readable. You need to take the time to choose them wisely and keep them relevant. Names are too important to treat carelessly. Names should not cause confusion." (Robert C. Martin, Clean Code) Names should not cause confusion. Find the names (identifiers) of user-defined objects that are SQL keywords that are not completely unreserved in PostgreSQL, i.e., these either never cannot be used as regular identifiers or cannot be used in case of some type of database objects. In PostgreSQL "there are several different classes of tokens ranging from those that can never be used as an identifier to those that have absolutely no special status in the parser as compared to an ordinary identifier. " (PostgreSQL manual) Moreover, such identifiers are often too general, i.e., do not provide enough information about the named object. | Problem detection | INFORMATION_SCHEMA+system catalog base tables | 2024-12-21 17:21 | MIT License | |
793 | Using routine name in front of a parameter name in a routine body to refer to the parameter of the routine | Write code that is easy to understand and not unnecessarily long. A routine cannot have two or more parameters with the same name. In this case using longer identifier in the form routine_name.parameter name is unnecessary. | Problem detection | INFORMATION_SCHEMA+system catalog base tables | 2021-11-05 13:40 | MIT License | |
794 | Using unreserved (in PostgreSQL) SQL keywords as the names of a database object (aggregate view) | "Names in software are 90 percent of what make software readable. You need to take the time to choose them wisely and keep them relevant. Names are too important to treat carelessly. Names should not cause confusion." (Robert C. Martin, Clean Code) Names should not cause confusion. Find the distinct names (identifiers) of user-defined objects that are SQL keywords that are completely unreserved in PostgreSQL. In PostgreSQL "there are several different classes of tokens ranging from those that can never be used as an identifier to those that have absolutely no special status in the parser as compared to an ordinary identifier. " (PostgreSQL manual) Although the names are unreserved keywords in PostgreSQL these could be reserved keywords in other systems, which would complicate database migration. Moreover, such identifiers are often too general, i.e., do not provide enough information about the named object. | Problem detection | INFORMATION_SCHEMA+system catalog base tables | 2024-12-21 17:17 | MIT License | |
795 | Using unreserved (in PostgreSQL) SQL keywords as the names of a database object (detailed view) | "Names in software are 90 percent of what make software readable. You need to take the time to choose them wisely and keep them relevant. Names are too important to treat carelessly. Names should not cause confusion." (Robert C. Martin, Clean Code) Names should not cause confusion. Find the names (identifiers) of user-defined objects that are SQL keywords that are completely unreserved in PostgreSQL. In PostgreSQL "there are several different classes of tokens ranging from those that can never be used as an identifier to those that have absolutely no special status in the parser as compared to an ordinary identifier. " (PostgreSQL manual) Although the names are unreserved keywords in PostgreSQL these could be reserved keywords in other systems, which would complicate database migration. Moreover, such identifiers are often too general, i.e., do not provide enough information about the named object. Think as to whether some better name would be possible. | Problem detection | INFORMATION_SCHEMA+system catalog base tables | 2024-12-21 17:17 | MIT License | |
796 | Validation method does not confirm | Find user-defined SQL and PL/pgSQL routines that do not return a value although the name suggest that it should return a value (starts with "validate" or "check"). | Problem detection | INFORMATION_SCHEMA+system catalog base tables | 2023-01-06 14:25 | MIT License | |
797 | Very similar (but not equal) routine names | Find pairs of names of different types of routines that are very similar but not equal. | Problem detection | INFORMATION_SCHEMA+system catalog base tables | 2024-11-30 12:09 | MIT License | |
798 | Very similar column names | Find the pairs of table columns that name is different only by one symbol and that have the same type and/or domain. | Problem detection | INFORMATION_SCHEMA+system catalog base tables | 2023-03-18 20:25 | MIT License | |
799 | Very similar table names | Find pairs of names of different types of tables that are very similar or even equal. | Problem detection | INFORMATION_SCHEMA+system catalog base tables | 2024-11-30 11:50 | MIT License | |
800 | Views without security barrier | Find views that do not have the security barrier option. | Problem detection | INFORMATION_SCHEMA+system catalog base tables | 2024-12-13 19:30 | MIT License |