Filter Queries

Found 997 queries.

  • All the queries about database objects contain a subcondition to exclude from the result information about the system catalog.
  • Although the statements use SQL constructs (common table expressions; NOT in subqueries) that could cause performance problems in case of large datasets it shouldn't be a problem in case of relatively small amount of data, which is in the system catalog of a database.
  • Statistics about the catalog content and project home in GitHub that has additional information.

# Name Goal Type Data source Last update License
801 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 View
802 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 View
803 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 View
804 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 View
805 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 View
806 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 View
807 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 View
808 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 2025-05-03 13:53 MIT License View
809 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 View
810 The name of the base table that implements a binary relationship type does not explain the meaning of the relationship Find base tables that implement a binary relationship type (have two foreign keys) and the name of the table consist of the names of tables that this (intermediate) table connect. The names should be derived from the domain. For instance, instead of name Course_Lecturer it is better to have name Teaching. Problem detection system catalog base tables only 2023-03-18 17:58 MIT License View
811 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 View
812 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, but other forms could be used as well. Problem detection INFORMATION_SCHEMA+system catalog base tables 2021-11-04 11:39 MIT License View
813 There is no reason to use PL/pgSQL if you do not use one or more features of a procedural language Using PL/pgSQL may cause context switching between declarative SQL and procedural PL/pgSQL. Thus use PL/pgSQL only if you truly need some of its constructs (variables, conditional statements, cycles, cursors, exception handling). Problem detection INFORMATION_SCHEMA+system catalog base tables 2021-11-04 16:32 MIT License View
814 There is no reason to use PL/pgSQL to write table functions Using PL/pgSQL may cause context switching between declarative SQL and procedural PL/pgSQL. Thus use PL/pgSQL only if you truly need some of its constructs. You can create table functions by using SQL. Problem detection INFORMATION_SCHEMA+system catalog base tables 2021-11-04 11:28 MIT License View
815 The same CHECK has a different name in different places Find the names of table CHECK constraints that have the same Boolean expression but a different naming style in different places (tables). The naming of constraints should be consistent. "If you do something a certain way, do all similar things in the same way." (Robert C. Martin, Clean Code)x Problem detection system catalog base tables only 2024-11-28 14:44 MIT License View
816 The same CHECK has a different name in different places (2) Find the names of table CHECK constraints that have the same Boolean expression but a different naming style in different places (tables). The naming of constraints should be consistent. "If you do something a certain way, do all similar things in the same way." (Robert C. Martin, Clean Code) Problem detection system catalog base tables only 2024-11-28 14:47 MIT License View
817 The same name is used in different contexsts Find the names that are used in case of different types of elements Problem detection INFORMATION_SCHEMA+system catalog base tables 2024-12-21 16:23 MIT License View
818 The same sequence generator is used in case of multiple columns Do not cause a potential performance bottleneck by having a shared resource. By having a shared sequence it is not possible to change properties of sequences of different tables independently (for instance the owner column or step), i.e., it increases coupling between tables. By having a shared sequence it is impossible to specify the owner (table column) to the sequence generator. Problem detection INFORMATION_SCHEMA only 2021-03-07 21:07 MIT License View
819 The SQL-language routines with the body that is string literal Find SQL-language routines that have the body that is string literal, i.e., the body is not SQL-standard function body. Routines with a SQL-standard body are permitted starting from PostgreSQL 14. Problem detection INFORMATION_SCHEMA+system catalog base tables 2024-01-24 18:20 MIT License View
820 Three-valued logic (Boolean columns) Find base table columns that have Boolean type and do not have NOT NULL constraint. Use two-valued logic (TRUE, FALSE) instead of three-valued logic (TRUE, FALSE, UNKNOWN). Because NULL in a Boolean column means unknown make all the Boolean columns mandatory. Problem detection INFORMATION_SCHEMA only 2021-02-25 17:30 MIT License View