Filter Queries

Found 1077 queries.

Page 6 of 54
  • 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 the relatively small amount of data in the system catalog of a database.

#101. Inconsistency between the name and the type of a base table column (dates)

INFORMATION_SCHEMA only

Find base table columns that name refers to the possibility that these are used to register dates. 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 data type is "date", then the suffix of the column name should be "kp" (Estonian) or "date" (English).

Problem detection License: MIT (opens in new tab)

#102. Inconsistency between the name and the type of a base table column (timestamps)

INFORMATION_SCHEMA only

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 License: MIT (opens in new tab)

#103. Inconsistency between the type and the default value of a column (date and timestamp values)

INFORMATION_SCHEMA only

Find table columns with timestamp/date types that data type and dynamically found default value have a different type.

Problem detection License: MIT (opens in new tab)

#104. Inconsistency between the type and the default value of a column (time values)

INFORMATION_SCHEMA only

Find table columns with time types, which data type and dynamically found default value have a different type.

Problem detection License: MIT (opens in new tab)

#105. Inconsistent data types for audit timestamps

INFORMATION_SCHEMA only

This query checks whether columns used to record registration and last update times have inconsistent data types across the database. Using varying data types for these temporal columns (for example, mixing timestamp and timestamptz) can lead to unexpected timezone behaviors and complicate time-based calculations.

Problem detection License: MIT (opens in new tab)

#106. Inconsistent data type usage in case of registering a date

INFORMATION_SCHEMA only

Find as to whether there are multiple different types used in case of columns that are meant for registering dates.

Problem detection License: MIT (opens in new tab)

#107. Inconsistent data type usage in case of registering a symbol

INFORMATION_SCHEMA only

Find whether the database uses both CHAR(1) and VARCHAR(1) columns to register a single symbol.

Problem detection License: MIT (opens in new tab)

#108. Inconsistent data type usage in case of registering sums of money

INFORMATION_SCHEMA only

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 License: MIT (opens in new tab)

#109. Inconsistent lengths in standard address columns

INFORMATION_SCHEMA only

This query checks whether columns storing standardized data—such as email addresses, phone numbers, IP addresses, postal codes, physical addresses, and file paths—have inconsistent field sizes across different tables. Identifying these discrepancies helps maintain a uniform database schema.

Problem detection License: MIT (opens in new tab)

#110. Inconsistent means to calculate tsvector values

INFORMATION_SCHEMA only

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 License: MIT (opens in new tab)

#111. Inconsistent naming of registration time columns

INFORMATION_SCHEMA only

This query checks whether timestamp columns used to record registration times are named consistently across different tables. Maintaining a uniform naming convention (such as always using created_at or reg_time) significantly improves schema readability and maintainability.

Problem detection License: MIT (opens in new tab)

#112. Inconsistent naming of update time columns

INFORMATION_SCHEMA only

This query checks whether timestamp columns used to record last update times are named consistently across different tables. Using a uniform naming convention (such as consistently using updated_at or last_modified) significantly improves database schema readability and maintainability.

Problem detection License: MIT (opens in new tab)

#113. Inconsistent precision and scale usage in case of registering sums of money

INFORMATION_SCHEMA only

Find as to whether different precisions/scales are used in case of registering data about sums of money in different columns.

Problem detection License: MIT (opens in new tab)

#114. Inconsistent time zone and precision usage in case of registering times

INFORMATION_SCHEMA only

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 License: MIT (opens in new tab)

#115. Inconsistent time zone and precision usage in case of registering timestamps

INFORMATION_SCHEMA only

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 License: MIT (opens in new tab)

#116. Incorrect data type (based on default values)

INFORMATION_SCHEMA only

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 License: MIT (opens in new tab)

#117. Incorrect field size (based on default values)

INFORMATION_SCHEMA only

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 License: MIT (opens in new tab)

#118. Incorrect field size (based on default values) (2)

INFORMATION_SCHEMA only

This query identifies potential schema discrepancies related to column sizing. It flags text columns in base tables where the static default value is unusually short—specifically, less than half the column's maximum allowed capacity.

Problem detection License: MIT (opens in new tab)

#119. Incorrect prevention of the empty string or strings that consist of only spaces in a field

INFORMATION_SCHEMA only

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 License: MIT (opens in new tab)

#120. Incorrect use of non-deterministic functions in CHECK constraints

INFORMATION_SCHEMA only

This query identifies CHECK constraints that use non-deterministic time functions (such as now or current_date) in a way that causes initially valid data to become invalid over time. For example, a constraint like localtimestamp(0) > end_date is an anti-pattern because advancing time will eventually violate it. However, safe implementations—such as birth_date < CURRENT_DATE—are permitted, because once the condition is met, it remains true indefinitely as time moves forward.

Problem detection License: MIT (opens in new tab)
# Name(activate to sort ascending) Goal(activate to sort ascending) Type(activate to sort ascending) Data source(sorted ascending, activate to sort descending) Last update(activate to sort ascending) License Actions
101 Inconsistency between the name and the type of a base table column (dates) Find base table columns that name refers to the possibility that these are used to register dates. 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 data type is "date", then the suffix of the column name should be "kp" (Estonian) or "date" (English). Problem detection INFORMATION_SCHEMA only MIT (opens in new tab) View
102 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 MIT (opens in new tab) View
103 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 MIT (opens in new tab) View
104 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 MIT (opens in new tab) View
105 Inconsistent data types for audit timestamps This query checks whether columns used to record registration and last update times have inconsistent data types across the database. Using varying data types for these temporal columns (for example, mixing timestamp and timestamptz) can lead to unexpected timezone behaviors and complicate time-based calculations. Problem detection INFORMATION_SCHEMA only MIT (opens in new tab) View
106 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 MIT (opens in new tab) View
107 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 MIT (opens in new tab) View
108 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 MIT (opens in new tab) View
109 Inconsistent lengths in standard address columns This query checks whether columns storing standardized data—such as email addresses, phone numbers, IP addresses, postal codes, physical addresses, and file paths—have inconsistent field sizes across different tables. Identifying these discrepancies helps maintain a uniform database schema. Problem detection INFORMATION_SCHEMA only MIT (opens in new tab) View
110 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 MIT (opens in new tab) View
111 Inconsistent naming of registration time columns This query checks whether timestamp columns used to record registration times are named consistently across different tables. Maintaining a uniform naming convention (such as always using created_at or reg_time) significantly improves schema readability and maintainability. Problem detection INFORMATION_SCHEMA only MIT (opens in new tab) View
112 Inconsistent naming of update time columns This query checks whether timestamp columns used to record last update times are named consistently across different tables. Using a uniform naming convention (such as consistently using updated_at or last_modified) significantly improves database schema readability and maintainability. Problem detection INFORMATION_SCHEMA only MIT (opens in new tab) View
113 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 MIT (opens in new tab) View
114 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 MIT (opens in new tab) View
115 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 MIT (opens in new tab) View
116 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 MIT (opens in new tab) View
117 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 MIT (opens in new tab) View
118 Incorrect field size (based on default values) (2) This query identifies potential schema discrepancies related to column sizing. It flags text columns in base tables where the static default value is unusually short—specifically, less than half the column's maximum allowed capacity. Problem detection INFORMATION_SCHEMA only MIT (opens in new tab) View
119 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 MIT (opens in new tab) View
120 Incorrect use of non-deterministic functions in CHECK constraints This query identifies CHECK constraints that use non-deterministic time functions (such as now or current_date) in a way that causes initially valid data to become invalid over time. For example, a constraint like localtimestamp(0) > end_date is an anti-pattern because advancing time will eventually violate it. However, safe implementations—such as birth_date < CURRENT_DATE—are permitted, because once the condition is met, it remains true indefinitely as time moves forward. Problem detection INFORMATION_SCHEMA only MIT (opens in new tab) View