Seq nr | Name | Goal | Type | Data source▲ | Last update | License | ... |
---|---|---|---|---|---|---|---|
761 | 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 | |
762 | 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 | 2023-03-17 11:19 | MIT License | |
763 | 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 | 2023-03-18 16:39 | MIT License | |
764 | 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 | |
765 | 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 | 2023-03-17 11:18 | MIT License | |
766 | 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 | 2023-03-17 11:20 | MIT License | |
767 | 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 | |
768 | 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 | |
769 | Views without security barrier | Find views that do not have the security barrier option. | Problem detection | INFORMATION_SCHEMA+system catalog base tables | 2023-11-22 12:05 | MIT License | |
770 | Views with unnecessary security invoker | Find views with security invoker option that do not have any underlying base table with a security policy. Security invoker option of views is possible starting from PostgreSQL 15. "The main use case (and the one that inspired the feature) is to be able to use views and still check row-level security policies on the underlying tables as the invoker." | Problem detection | INFORMATION_SCHEMA+system catalog base tables | 2023-11-17 18:39 | MIT License | |
771 | Views with WHERE but without security barrier | Find views that do not have the security barrier option but restrict rows in some way. | Problem detection | INFORMATION_SCHEMA+system catalog base tables | 2024-01-14 12:58 | MIT License | |
772 | Wrong comment - trigger function does not implement a database operation | Trigger functions should not contain references to database operations. Perhaps the trigger implements ensuring some invariant of the operation but it does not implement the operation itself. | Problem detection | INFORMATION_SCHEMA+system catalog base tables | 2021-02-25 17:30 | MIT License | |
773 | YELLING IN COMMENTS! | Find comments of derived tables and routines that consist of only uppercase letters. Do not use only uppercase (capital) letters in order to write comments. It means yelling and also makes text less readable. | Problem detection | INFORMATION_SCHEMA+system catalog base tables | 2024-04-25 15:13 | MIT License | |
774 | All clustered indexes | Find all tables that rows have been physically sorted based on an index. | General | system catalog base tables only | 2022-10-31 10:17 | MIT License | |
775 | All database privileges | Find the privileges to use the database. c - CONNECT; C - CREATE; T - TEMPORARY. | General | system catalog base tables only | 2021-11-23 20:28 | MIT License | |
776 | All event triggers | Find event triggers, which are not associated to a specific schema object. | General | system catalog base tables only | 2020-12-24 14:54 | MIT License | |
777 | All exclude constraints | Find all exclude constraints. | General | system catalog base tables only | 2021-12-16 11:21 | MIT License | |
778 | All foreign key constraints | Enforce referential integrity in database. Find all referential integrity (foreign key) constraints. | General | system catalog base tables only | 2023-12-07 12:48 | MIT License | |
779 | All identifying relationships | Find all non-identifying relationships where the foreign key (a set of columns) is a subset of a uniqueness constraint (primary key, unique, or exclude constraint). | General | system catalog base tables only | 2023-11-01 11:32 | MIT License | |
780 | All key constraints | Find all the primary key and unique constraints of base tables. | General | system catalog base tables only | 2021-10-16 10:37 | MIT License |