Filter Queries

Found 1056 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 the relatively small amount of data in the system catalog of a database.

#241. Base table column of personal names does not restrict the maximum character length

INFORMATION_SCHEMA+system catalog base tables

This query identifies base table columns that, based on their name, are presumed to store personal names but lack an explicit maximum length constraint. It operates on a heuristic, flagging columns with names like first_name, surname, etc., that are defined with unbounded textual types (e.g., text, varchar) and have no corresponding CHECK constraint to limit their length (e.g., char_length(col) <= n). The absence of such a limit is a design flaw that can introduce usability issues in front-end applications and create potential security vulnerabilities related to excessive data submission.

Problem detection License: MIT (opens in new tab)

#242. Base table column of personal names has questionable properties

INFORMATION_SCHEMA only

Find base table columns that name refers to the possibility that these are used to register personal names. Although there are very long personal names the general approach is to register a shortened version of these. Thus, a large field size is not a good idea because it would cause usability and security problems. There are persons who only have one name component (mononymous persons). Database design must take it into account.

Problem detection License: MIT (opens in new tab)

#243. Base table column of quantities does not have a numeric type (based on column names)

INFORMATION_SCHEMA only

Find base table columns that name refers to the possibility that these are used to register quantities of things. Find the columns that do not have a numeric type.

Problem detection License: MIT (opens in new tab)

#244. Base table column of sums of money does not have a numeric type (based on column names)

INFORMATION_SCHEMA only

Find base table columns that name refers to the possibility that these are used to register prices/sums of money. Find columns that do not have a numeric type.

Problem detection License: MIT (opens in new tab)

#245. Base table column of sums of money has too big or small scale

INFORMATION_SCHEMA only

Find base table columns that name refers to the possibility that these are used to register data about prices/sums of money. Find the columns that have decimal type but have a too big (bigger than six) or a too small scale (zero). The selection of field size must be precise and should take into account the possible data in the column.

Problem detection License: MIT (opens in new tab)

#246. Base table column of surrogate key values does not have an integer data type (based on column names)

INFORMATION_SCHEMA+system catalog base tables

Find base table columns that belong to a primary key, unique, or foreign key constraint and that name refers to the possibility that these are used to hold surrogate key values. Find the columns where the data type of the column is not an integer type or uuid.

Problem detection License: MIT (opens in new tab)

#247. Base table columns for recording geographic coordinates that do not have a suitable type (based on column names)

INFORMATION_SCHEMA only

Find base table columns that are according to the name meant for recording geographic coordinate but do not have a suitable type (numeric or point).

Problem detection License: MIT (opens in new tab)

#248. Base table columns permitting e-mail addresses without @ sign

INFORMATION_SCHEMA+system catalog base tables

Find non-foreign key base table columns that name refers to the possibility that these are used to register e-mail addresses. Find the columns that do not have any simple CHECK constraint that contains @ sign. A simple check constraint covers a single column. In this case registration of e-mail addresses without @ is most probably not prohibited.

Problem detection License: MIT (opens in new tab)

#249. Base table columns permitting empty strings and strings that consist of only whitespace characters (2)

INFORMATION_SCHEMA+system catalog base tables

This query identifies non-foreign key columns with a textual data type that lack essential validation. It specifically targets columns that are missing both of the following fundamental checks:


  • A constraint to prohibit the insertion of empty or whitespace-only strings.
  • A constraint to enforce a character set or format policy (e.g., via a regular expression).

The absence of such comprehensive validation increases the risk of poor data quality and potential application-level bugs.

Problem detection License: MIT (opens in new tab)

#250. Base table columns permitting negative prices/quantity

INFORMATION_SCHEMA+system catalog base tables

Find non-foreign key base table columns that name refers to the possibility that these are used to register prices/quantities. Find the columns that do not have any simple CHECK constraints, i.e., a constraint that covers only this column. In this case registration of negative price/quantity is most probably not prohibited.

Problem detection License: MIT (opens in new tab)

#251. Base table columns permitting temporal values that may be outside the range of logical values

INFORMATION_SCHEMA+system catalog base tables

Find base tables columns with temporal types (date and timestamp) that do not belong to a foreign key and that do not have any associated simple CHECK constraints, i.e., constraint that involves only one column. For instance, in the column registration_time that does not have any associated CHECK constraints could be values '1200-01-01 00:00' or '5900-12-31 00:00'. Rows with these values most probably represent wrong propositions and the system should restrict registration of such data.

Problem detection License: MIT (opens in new tab)

#252. Base table columns permitting URLs without a protocol

INFORMATION_SCHEMA+system catalog base tables

Find non-foreign key base table columns that name refers to the possibility that these are used to register URLs. Find the columns that do not have any simple CHECK constraint that references to a protocol. A simple check constraint covers a single column. In this case registration of URLs without a protocol is most probably not prohibited.

Problem detection License: MIT (opens in new tab)

#253. Base table columns that lack any simple CHECK, i.e, permit empty strings and strings that consist of only whitespace characters

INFORMATION_SCHEMA+system catalog base tables

This query identifies non-foreign key columns of base tables with a textual data type that lack any simple (single-column) CHECK constraint. The absence of such constraints indicates a complete lack of column-level validation, creating a risk of low-quality data ingress, including the implicit allowance of empty or whitespace-only strings.

Problem detection License: MIT (opens in new tab)

#254. Base table columns where TOAST-ing strategy has been changed to plain

system catalog base tables only

Find base table columns in case of which the system can use TOAST technique (due to the data type of the column) and where the toasting strategy has been changed to plain. It means that potentially, if a value in the column is large enough, it is not possible to save the row.

Problem detection License: MIT (opens in new tab)

#255. Base table columns with the same name and type have different field sizes

INFORMATION_SCHEMA only

Find base table columns that have the same name and type but different field size.

Problem detection License: MIT (opens in new tab)

#256. Base table columns with the same name have different types

INFORMATION_SCHEMA only

This query identifies semantic inconsistencies across the database schema by finding base table columns that share the same identifier (name) but are defined with differing data types. According to standard data modeling principles, a shared attribute name implies a shared domain concept (e.g., status_code should consistently be an SMALLINT or a CHAR). Discrepancies in data types for homonymous columns (e.g., is_active being BOOLEAN in one table and SMALLINT in another) hinder interoperability, complicate join logic, and confuse developers.

Problem detection License: MIT (opens in new tab)

#257. Base table columns with the type VARCHAR(1)

INFORMATION_SCHEMA only

The choice of data types should reveal as much as possible about the nature of the data in the column. The type of these columns could be CHAR(1) and they should have a constraint that a value in the column cannot be an empty string.

Problem detection License: MIT (opens in new tab)

#258. Base tables and foreign tables that do not have any CHECK constraints on non-foreign key columns

INFORMATION_SCHEMA+system catalog base tables

Identify possibly missing CHECK constraints.

Problem detection License: MIT (opens in new tab)

#259. Base tables and foreign tables that have no CHECK constraints

INFORMATION_SCHEMA only

What are the base tables and foreign tables without any associated (directly or through domains) check constraints? A NOT NULL constraint is a kind of CHECK constraint. However, this query does not take into account NOT NULL constraints.

Problem detection License: MIT (opens in new tab)

#260. Base tables and materialized views without any index

INFORMATION_SCHEMA+system catalog base tables

Find base tables and materialized views that do not have any index.

Problem detection License: MIT (opens in new tab)
# Name(activate to sort ascending) Goal(activate to sort ascending) Type(sorted ascending, activate to sort descending) Data source(activate to sort ascending) Last update(activate to sort ascending) License Actions
241 Base table column of personal names does not restrict the maximum character length This query identifies base table columns that, based on their name, are presumed to store personal names but lack an explicit maximum length constraint. It operates on a heuristic, flagging columns with names like first_name, surname, etc., that are defined with unbounded textual types (e.g., text, varchar) and have no corresponding CHECK constraint to limit their length (e.g., char_length(col) <= n). The absence of such a limit is a design flaw that can introduce usability issues in front-end applications and create potential security vulnerabilities related to excessive data submission. Problem detection INFORMATION_SCHEMA+system catalog base tables MIT (opens in new tab) View (opens in new tab)
242 Base table column of personal names has questionable properties Find base table columns that name refers to the possibility that these are used to register personal names. Although there are very long personal names the general approach is to register a shortened version of these. Thus, a large field size is not a good idea because it would cause usability and security problems. There are persons who only have one name component (mononymous persons). Database design must take it into account. Problem detection INFORMATION_SCHEMA only MIT (opens in new tab) View (opens in new tab)
243 Base table column of quantities does not have a numeric type (based on column names) Find base table columns that name refers to the possibility that these are used to register quantities of things. Find the columns that do not have a numeric type. Problem detection INFORMATION_SCHEMA only MIT (opens in new tab) View (opens in new tab)
244 Base table column of sums of money does not have a numeric type (based on column names) Find base table columns that name refers to the possibility that these are used to register prices/sums of money. Find columns that do not have a numeric type. Problem detection INFORMATION_SCHEMA only MIT (opens in new tab) View (opens in new tab)
245 Base table column of sums of money has too big or small scale Find base table columns that name refers to the possibility that these are used to register data about prices/sums of money. Find the columns that have decimal type but have a too big (bigger than six) or a too small scale (zero). The selection of field size must be precise and should take into account the possible data in the column. Problem detection INFORMATION_SCHEMA only MIT (opens in new tab) View (opens in new tab)
246 Base table column of surrogate key values does not have an integer data type (based on column names) Find base table columns that belong to a primary key, unique, or foreign key constraint and that name refers to the possibility that these are used to hold surrogate key values. Find the columns where the data type of the column is not an integer type or uuid. Problem detection INFORMATION_SCHEMA+system catalog base tables MIT (opens in new tab) View (opens in new tab)
247 Base table columns for recording geographic coordinates that do not have a suitable type (based on column names) Find base table columns that are according to the name meant for recording geographic coordinate but do not have a suitable type (numeric or point). Problem detection INFORMATION_SCHEMA only MIT (opens in new tab) View (opens in new tab)
248 Base table columns permitting e-mail addresses without @ sign Find non-foreign key base table columns that name refers to the possibility that these are used to register e-mail addresses. Find the columns that do not have any simple CHECK constraint that contains @ sign. A simple check constraint covers a single column. In this case registration of e-mail addresses without @ is most probably not prohibited. Problem detection INFORMATION_SCHEMA+system catalog base tables MIT (opens in new tab) View (opens in new tab)
249 Base table columns permitting empty strings and strings that consist of only whitespace characters (2) This query identifies non-foreign key columns with a textual data type that lack essential validation. It specifically targets columns that are missing both of the following fundamental checks:

  • A constraint to prohibit the insertion of empty or whitespace-only strings.
  • A constraint to enforce a character set or format policy (e.g., via a regular expression).

The absence of such comprehensive validation increases the risk of poor data quality and potential application-level bugs.
Problem detection INFORMATION_SCHEMA+system catalog base tables MIT (opens in new tab) View (opens in new tab)
250 Base table columns permitting negative prices/quantity Find non-foreign key base table columns that name refers to the possibility that these are used to register prices/quantities. Find the columns that do not have any simple CHECK constraints, i.e., a constraint that covers only this column. In this case registration of negative price/quantity is most probably not prohibited. Problem detection INFORMATION_SCHEMA+system catalog base tables MIT (opens in new tab) View (opens in new tab)
251 Base table columns permitting temporal values that may be outside the range of logical values Find base tables columns with temporal types (date and timestamp) that do not belong to a foreign key and that do not have any associated simple CHECK constraints, i.e., constraint that involves only one column. For instance, in the column registration_time that does not have any associated CHECK constraints could be values '1200-01-01 00:00' or '5900-12-31 00:00'. Rows with these values most probably represent wrong propositions and the system should restrict registration of such data. Problem detection INFORMATION_SCHEMA+system catalog base tables MIT (opens in new tab) View (opens in new tab)
252 Base table columns permitting URLs without a protocol Find non-foreign key base table columns that name refers to the possibility that these are used to register URLs. Find the columns that do not have any simple CHECK constraint that references to a protocol. A simple check constraint covers a single column. In this case registration of URLs without a protocol is most probably not prohibited. Problem detection INFORMATION_SCHEMA+system catalog base tables MIT (opens in new tab) View (opens in new tab)
253 Base table columns that lack any simple CHECK, i.e, permit empty strings and strings that consist of only whitespace characters This query identifies non-foreign key columns of base tables with a textual data type that lack any simple (single-column) CHECK constraint. The absence of such constraints indicates a complete lack of column-level validation, creating a risk of low-quality data ingress, including the implicit allowance of empty or whitespace-only strings. Problem detection INFORMATION_SCHEMA+system catalog base tables MIT (opens in new tab) View (opens in new tab)
254 Base table columns where TOAST-ing strategy has been changed to plain Find base table columns in case of which the system can use TOAST technique (due to the data type of the column) and where the toasting strategy has been changed to plain. It means that potentially, if a value in the column is large enough, it is not possible to save the row. Problem detection system catalog base tables only MIT (opens in new tab) View (opens in new tab)
255 Base table columns with the same name and type have different field sizes Find base table columns that have the same name and type but different field size. Problem detection INFORMATION_SCHEMA only MIT (opens in new tab) View (opens in new tab)
256 Base table columns with the same name have different types This query identifies semantic inconsistencies across the database schema by finding base table columns that share the same identifier (name) but are defined with differing data types. According to standard data modeling principles, a shared attribute name implies a shared domain concept (e.g., status_code should consistently be an SMALLINT or a CHAR). Discrepancies in data types for homonymous columns (e.g., is_active being BOOLEAN in one table and SMALLINT in another) hinder interoperability, complicate join logic, and confuse developers. Problem detection INFORMATION_SCHEMA only MIT (opens in new tab) View (opens in new tab)
257 Base table columns with the type VARCHAR(1) The choice of data types should reveal as much as possible about the nature of the data in the column. The type of these columns could be CHAR(1) and they should have a constraint that a value in the column cannot be an empty string. Problem detection INFORMATION_SCHEMA only MIT (opens in new tab) View (opens in new tab)
258 Base tables and foreign tables that do not have any CHECK constraints on non-foreign key columns Identify possibly missing CHECK constraints. Problem detection INFORMATION_SCHEMA+system catalog base tables MIT (opens in new tab) View (opens in new tab)
259 Base tables and foreign tables that have no CHECK constraints What are the base tables and foreign tables without any associated (directly or through domains) check constraints? A NOT NULL constraint is a kind of CHECK constraint. However, this query does not take into account NOT NULL constraints. Problem detection INFORMATION_SCHEMA only MIT (opens in new tab) View (opens in new tab)
260 Base tables and materialized views without any index Find base tables and materialized views that do not have any index. Problem detection INFORMATION_SCHEMA+system catalog base tables MIT (opens in new tab) View (opens in new tab)