Seq nr | Name | Goal | Type▲ | Data source | Last update | License | ... |
---|---|---|---|---|---|---|---|
761 | Stating the obvious (2) | Find the names of database objects where the name of the database object contains a part of the name of the object type. For instance, the query finds base tables, were the name contains fragments _base, base_, _table, or table_. | Problem detection | INFORMATION_SCHEMA+system catalog base tables | 2023-11-26 17:04 | MIT License | |
762 | Stating the obvious (column names) | Find the names of columns where the name of the column contains a part of the name of the data type of the column. For instance, the query finds columns, were the name contains fragments integer_ or _integer. | Problem detection | INFORMATION_SCHEMA only | 2023-11-04 15:19 | MIT License | |
763 | Subqueries of derived tables with LIMIT/FETCH/DISTINCT ON without ORDER BY | Find subqueries of derived tables (views, materialized views) with the LIMIT/FETCH clause or with DISTINCT ON construct but without the ORDER BY clause. These constructs require sorting to produce a meaningful result. | Problem detection | INFORMATION_SCHEMA+system catalog base tables | 2023-11-03 16:56 | MIT License | |
764 | Surrogate key columns that do not follow the naming style | Find surrogate key columns that name does not end with "id_" or start with "id_". | Problem detection | INFORMATION_SCHEMA+system catalog base tables | 2023-11-16 12:19 | MIT License | |
765 | System-generated domain CHECK constraint names | Find the names of domain CHECK constraints that have been system-generated. Names should follow the same style. If there is a mix of system-generated and user-defined names, then the style is most probably different. | Problem detection | INFORMATION_SCHEMA only | 2022-10-27 15:44 | MIT License | |
766 | System-generated table constraint names (constraints that involve one column) | Find the names of database constraints that have been system-generated. Additional restrictions are that the constraints must involve only one column and are associated directly with a table (not through a domain). Names should follow the same style. If there is a mix of system-generated and user-defined names, then the style is most probably different. | Problem detection | system catalog base tables only | 2021-12-10 12:47 | MIT License | |
767 | Table columns with NOT VALID CHECK constraints | Find CHECK constraints of base table and foreign table columns that are not valid. These constraints have been created so that the existing data has not been checked against the constraint. It could be deliberate in case of legacy systems that have data quality problems. However, ideally all the data in the table conforms to the constraint. | Problem detection | INFORMATION_SCHEMA only | 2021-02-25 17:29 | MIT License | |
768 | Table constraints with the same name (constraints connected directly with a base table or a foreign table) | Find base table and foreign table constraint names that are used in a database more than once (possibly in different schemas or in case of different types of constraints). Different things should have different names. But here different constraints have the same name. Also make sure that this is not a sign of duplication. | Problem detection | system catalog base tables only | 2022-11-15 16:43 | MIT License | |
769 | Table functions with OFFSET | Find table functions that use OFFSET. OFFSET method is a common way for implementing pagination. | Problem detection | INFORMATION_SCHEMA+system catalog base tables | 2023-11-09 12:13 | MIT License | |
770 | Table privileges have been granted to PUBLIC | You should follow the principle of least privilege and thus not have in your database tables that usage privileges are granted to the pseudo-role PUBLIC, i.e., to all the database users now and in the future. | Problem detection | INFORMATION_SCHEMA only | 2021-02-25 17:30 | MIT License | |
771 | Table, routine, and usage privileges that have been granted to a superuser | Find table, routine, and usage privileges that have been granted to a superuser. Superuser can do anything in the database and thus does not need the privileges. The result is a sign that perhaps the executed GRANT statements were incorrect (wrong username) or the grantee later got superuser status (that it shouldn't have). | Problem detection | INFORMATION_SCHEMA+system catalog base tables | 2021-02-25 17:30 | MIT License | |
772 | Tables without columns | Do not have in a database elements that are not useful. PostgreSQL permits tables with no columns. Such tables can be used to implement Boolean variables (tables TABLE_DEE and TABLE_DUM). On the other hand, such tables might be a result of database evolution, where developers have not noticed that they have dropped all the columns of a table or have not noticed that they have created such a table in the first place. | Problem detection | INFORMATION_SCHEMA+system catalog base tables | 2021-02-25 17:29 | MIT License | |
773 | Temporal function in a simple check constraint is inconsistent with the column type | Find base table columns with a check constraint that refers to a temporal function (current_timestamp, localtimestamp, current_date, or now) that return type is inconsistent with the data type of the column. | Problem detection | INFORMATION_SCHEMA+system catalog base tables | 2023-11-08 21:43 | MIT License | |
774 | Textual columns that have a secondary index but the operator class for the column does not support pattern matching | Find indexed textual columns where the indexing does not consider the possibility of pattern-based search. Such columns do not have an index where the used operator class makes the index suitable for use by queries involving pattern matching expressions. | Problem detection | INFORMATION_SCHEMA+system catalog base tables | 2023-11-07 11:52 | MIT License | |
775 | TG_ARGV is missing | Write correct code. If you pass arguments to a trigger function, then the function should use the arguments. TG_ARGV[]: "Data type array of text; the arguments from the CREATE TRIGGER statement. The index counts from 0. Invalid indexes (less than 0 or greater than or equal to tg_nargs) result in a null value." (PostgreSQL documentation) | Problem detection | INFORMATION_SCHEMA+system catalog base tables | 2021-02-25 17:30 | MIT License | |
776 | The expression of a check constraint that is associated with a domain needs type conversion | Find check constraints of domains where the Boolean expression invokes an operation that does not match with the data type of the domain. | Problem detection | INFORMATION_SCHEMA only | 2021-02-25 17:29 | MIT License | |
777 | The expression of a simple check constraint that is associated directly with a column needs type conversion | Find check constraints that involve one column and are associated directly with a table where the Boolean expression invokes an operation that does not match with the data type of the column. | Problem detection | INFORMATION_SCHEMA+system catalog base tables | 2021-02-25 17:29 | MIT License | |
778 | The generator of surrogate key values can output the same value more than once | Find surrogate keys where the generator can output the same value more than once. Key values must be unique, i.e., at some point the generator will prevent adding new rows to the table. | Problem detection | INFORMATION_SCHEMA+system catalog base tables | 2021-03-08 00:40 | MIT License | |
779 | The generic names (columns) (aggregate view) | Find the too generic column names and the number of their occurrences. | Problem detection | INFORMATION_SCHEMA+system catalog base tables | 2023-01-15 10:34 | MIT License | |
780 | The maximum number of characters may be missing | Perhaps the character maximum length has been omitted accidentally, i.e., one wrote VARCHAR instead of VARCHAR(n) where n is the maximum permitted number of characters in the field value. VARCHAR and TEXT are synonyms. | Problem detection | INFORMATION_SCHEMA only | 2021-02-25 17:29 | MIT License |