Filter Queries

Found 1040 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
101 Inconsistency between the name and the type of a base table column (timestamps) Find base table columns that name refers to the possibility that these are used to register timestamps. Find the columns that do not have an appropriate data type. Column names should reflect the data that is possible to record in the column. For instance, in case of temporal data the column name should indicate as to whether we record dates or timestamps. If the column type is "timestamp", then the suffix of the column name should be "aeg" (Estonian) or "time" (English). Problem detection INFORMATION_SCHEMA only 2025-11-07 10:11 MIT License View
102 Inconsistency between the type and the default value of a column (date and timestamp values) Find table columns with timestamp/date types that data type and dynamically found default value have a different type. Problem detection INFORMATION_SCHEMA only 2025-11-07 10:11 MIT License View
103 Inconsistency between the type and the default value of a column (time values) Find table columns with time types, which data type and dynamically found default value have a different type. Problem detection INFORMATION_SCHEMA only 2025-11-07 10:11 MIT License View
104 Inconsistent data type usage in case of registering a date Find as to whether there are multiple different types used in case of columns that are meant for registering dates. Problem detection INFORMATION_SCHEMA only 2025-11-07 10:11 MIT License View
105 Inconsistent data type usage in case of registering a symbol Find whether the database uses both CHAR(1) and VARCHAR(1) columns to register a single symbol. Problem detection INFORMATION_SCHEMA only 2025-11-07 10:11 MIT License View
106 Inconsistent data type usage in case of registering sums of money Find as to whether both the numeric type and integer types are used in case of columns that are meant for register data about prices. Problem detection INFORMATION_SCHEMA only 2025-11-07 10:11 MIT License View
107 Inconsistent field sizes of columns for addresses Find as to whether columns for holding e-mail addresses, phone numbers, ip addresses, zip codes, ordinary addresses, or file addresses have inconsistent field sizes across tables. Problem detection INFORMATION_SCHEMA only 2025-11-07 10:11 MIT License View
108 Inconsistent means to calculate tsvector values Find as to whether in the database there are multiple ways to calculate tsvector values, i.e., by using a generated column and by not using a generated column. Problem detection INFORMATION_SCHEMA only 2025-11-07 10:11 MIT License View
109 Inconsistent precision and scale usage in case of registering sums of money Find as to whether different precisions/scales are used in case of registering data about sums of money in different columns. Problem detection INFORMATION_SCHEMA only 2025-11-07 10:11 MIT License View
110 Inconsistent time zone and precision usage in case of registering times Find as to whether different data types (with and without timezone) and precisions are used in case of registering times in different columns. Problem detection INFORMATION_SCHEMA only 2025-11-07 10:11 MIT License View
111 Inconsistent time zone and precision usage in case of registering timestamps Find as to whether different data types (with and without timezone) and precisions are used in case of registering timestamps in different columns. Problem detection INFORMATION_SCHEMA only 2025-11-07 10:11 MIT License View
112 Incorrect data type (based on default values) Find columns of base tables that have the default value CURRENT_USER or SESSION_USER but the data type is CHAR or TEXT. Problem detection INFORMATION_SCHEMA only 2025-11-07 10:11 MIT License View
113 Incorrect field size (based on default values) This query identifies a potential schema mismatch regarding data precision. It flags base table columns that default to CURRENT_USER or SESSION_USER but define a character length differing from the PostgreSQL standard identifier limit (typically 63 bytes, defined by NAMEDATALEN - 1).

Risk (Length < 63): Poses a hard runtime failure risk if a username exceeds the defined length. Inefficiency (Length > 63): Indicates imprecise modeling, as the stored value can technically never exceed the system limit.
Problem detection INFORMATION_SCHEMA only 2025-12-15 11:09 MIT License View
114 Incorrect prevention of the empty string or strings that consist of only spaces in a field This query identifies ineffectual CHECK constraints on base and foreign table columns that incorrectly attempt to prohibit empty or whitespace-only strings using the predicate trim(column_name) IS NOT NULL. Due to PostgreSQL's strict distinction between an empty string ('') and NULL, this check is a tautology; trim('') evaluates to '', and the condition '' IS NOT NULL is always true. The query finds these logically flawed constraints, which fail to provide any data validation and permit the insertion of the exact values they were intended to prevent. Problem detection INFORMATION_SCHEMA only 2025-11-12 14:56 MIT License View
115 Incorrect use of non-deterministic functions in CHECK constraints Do not create a constraint in case of which data that satisfied a constraint c at the registration time suddenly does not satisfy it any more as the time goes by. Find all the check constraints that use non-deterministic functions (now, current_timestamp, localtimestamp, current_date, current_time) in a way that makes this situation possible. Fort instance, localtimestamp(0)>end_date is an example of such constraint. Problem detection INFORMATION_SCHEMA only 2025-11-07 10:11 MIT License View
116 Insufficient number of user-defined base tables This query performs a basic structural assessment of the database schema by counting the number of user-defined base tables. It verifies whether the data model meets a minimum complexity threshold, requiring the existence of at least 7 distinct base tables. This metric serves as a proxy for the scope and depth of the implemented domain model. Problem detection INFORMATION_SCHEMA only 2025-11-30 09:30 MIT License View
117 Insufficient number of user-defined foreign tables This query assesses the utilization of PostgreSQL's Foreign Data Wrapper (FDW) capabilities. It verifies the existence of at least 2 user-defined foreign tables within the database schema. This requirement ensures that the implemented solution demonstrates the ability to integrate and query data from external sources, extending the data model beyond local storage. Problem detection INFORMATION_SCHEMA only 2025-11-30 09:31 MIT License View
118 Insufficient number of user-defined views This query assesses the use of abstraction layers within the database schema. It verifies that there are at least 4 user-defined views present. Views are essential for simplifying complex queries, restricting data access, and presenting specific data perspectives to applications. Meeting this threshold indicates a sufficient implementation of data abstraction and query encapsulation. Problem detection INFORMATION_SCHEMA only 2025-11-30 09:38 MIT License View
119 IS DISTINCT FROM should be used instead of <> in WHEN clauses Use a right predicate in trigger condition in order to ensure that the trigger executes always when it has to but not more often. IS DISTINCT FROM treats NULL as if it was a known value, rather than unknown. It would be relevant if a column that is referenced in the action condition is optional, i.e., permits NULLs. Problem detection INFORMATION_SCHEMA only 2025-11-07 10:11 MIT License View
120 IS NULL check is probably not needed Find CHECK constraints that refer only to mandatory columns but the Boolean expression has IS NULL condition. Problem detection INFORMATION_SCHEMA only 2025-11-07 10:11 MIT License View