Filter Queries

Found 1053 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.

#241. Domain candidates

INFORMATION_SCHEMA+system catalog base tables

Find column descriptions that are candidates for describing a domain.

General License: MIT (opens in new tab)

#242. Too generic names (columns) (there is a column with a more specific name in the table)

INFORMATION_SCHEMA+system catalog base tables

Find column names in case of which the same table has another column (with more specific name) that name contains the column name in the end or in the beginning. For instance, a base table has columns parent and root_parent and the former col-umn name is too generic, i.e., it should be more specific.

Problem detection License: MIT (opens in new tab)

#243. Grantable column privileges

INFORMATION_SCHEMA+system catalog base tables

Find column privileges that the carrier of the privilege can in turn grant to others, i.e., the privileges have been given WITH GRANT OPTION. The number of privileges that can be passed on should be as small as possible.

Problem detection License: MIT (opens in new tab)

#244. Useless type indication

INFORMATION_SCHEMA+system catalog base tables

Find columns and parameters where the type of the identifier is perhaps explicitly indicated in the name.

Problem detection License: MIT (opens in new tab)

#245. Useless type indication (2)

INFORMATION_SCHEMA+system catalog base tables

Find columns and parameters where the type of the identifier is perhaps explicitly indicated in the name.

Problem detection License: MIT (opens in new tab)

#246. Empty columns

INFORMATION_SCHEMA+system catalog base tables

Find columns in non-empty tables that do not contain any values. If there are no values in a columns, then it may mean that one hasn't tested constraints that have been declared to the column or implemented by using triggers. It could also mean that such columns are not needed at all.

Problem detection License: MIT (opens in new tab)

#247. Storing a duration rather than a point in time

INFORMATION_SCHEMA only

Find columns of base and foreign tables that based on the column names and types are used to register start time and duration rather than start time and end time.

Problem detection License: MIT (opens in new tab)

#248. Storing a duration as time

INFORMATION_SCHEMA only

Find columns of base and foreign tables that based on the column names are used to register durations but the type of the column is time. "It is possible to use a TIME data type if the duration is less than 24 hours, but this is not what the type is intended for, and can be the cause of confusion for the next person who has to maintain your code."

Problem detection License: MIT (opens in new tab)

#249. Full text search columns with other type of index than gin or gist index

INFORMATION_SCHEMA+system catalog base tables

Find columns of base tabels and materialized views with the type tsvector that do not have a gin or a gist index but have another type of index (e.g., b-tree). Gin and Gist are the preferred index types for text search.

Problem detection License: MIT (opens in new tab)

#250. Full text search columns that have no gin or gist index

INFORMATION_SCHEMA+system catalog base tables

Find columns of base tabels and materialized views with the type tsvector that do not have a gin or a gist index. These are the preferred index types for text search.

Problem detection License: MIT (opens in new tab)

#251. Preventing strings that consist of only spaces instead of strings that consist of only whitespace characters

INFORMATION_SCHEMA only

Find columns of base tables and foreign tables where one uses a check constraint to prevent values that consist of only spaces. Make sure that this is the correct constraint and there is no need to prevent values that consist of only whitespace characters.

Problem detection License: MIT (opens in new tab)

#252. Columns with tsvector type

INFORMATION_SCHEMA+system catalog base tables

Find columns of base tables and materialized views that have tsvector type.

General License: MIT (opens in new tab)

#253. Only one value permitted in a non-inherited base table or a foreign table column (based on check constraints)

INFORMATION_SCHEMA+system catalog base tables

Find columns of base tables or foreign tables in case of which a check constraint on the column permits only one value in the column. Exclude columns that are inherited from a supertable because the constraint may be correct if it is applied to a column of a subtable that is inherited from the supertable.

Problem detection License: MIT (opens in new tab)

#254. Only one value permitted in a base table or a foreign table column (based on check constraints)

INFORMATION_SCHEMA+system catalog base tables

Find columns of base tables or foreign tables in case of which a check constraint on the column permits only one value in the column. The constraint may be correct if it is applied to a column of a subtable that is inherited from the supertable or is used to enfore the rule that the table can have at most one row.

General License: MIT (opens in new tab)

#255. Only one value permitted in a base table or a foreign table column (based on enumeration types)

INFORMATION_SCHEMA+system catalog base tables

Find columns of base tables or foreign tables in case of which the type of the column permits only one value in the column. The type is an enumeration type that specifies only one value.

Problem detection License: MIT (opens in new tab)

#256. Inappropriate field size or data type for column that strores database username

INFORMATION_SCHEMA only

Find columns of base tables that based on the default value of the column contain database username. However, the type of the column is not VARCHAR(63) or VARCHAR(128).

Problem detection License: MIT (opens in new tab)

#257. Potentially missing PRIMARY KEY or UNIQUE constraints (based on sequence generators)

INFORMATION_SCHEMA+system catalog base tables

Find columns of base tables that contain automatically generated unique values but do not belong to any PRIMARY KEY/UNIQUE constraint. If something has to be unique, then it must be said to the system so that it could use the information for internal optimizations and enforce the constraint.

Problem detection License: MIT (opens in new tab)

#258. Columns of base tables that hold truth values that do not have a default value although they could have it (non-Boolean columns)

INFORMATION_SCHEMA+system catalog base tables

Find columns of base tables that do not have type BOOLEAN but are used to record Boolean values. Based on column names these implement a state machine or record agreements. At the same time the columns do not have a default value. There are only two truth values - TRUE and FALSE - in case of two-valued logic. It should be possible to select one of these as the default value of the column.

Problem detection License: MIT (opens in new tab)

#259. Perhaps incorrect default vale

INFORMATION_SCHEMA only

Find columns of base tables that have default value CURRENT_USER.

Problem detection License: MIT (opens in new tab)

#260. 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)
# Name Goal (sorted ascending) Type Data source Last update License Actions
241 Domain candidates Find column descriptions that are candidates for describing a domain. General INFORMATION_SCHEMA+system catalog base tables MIT (opens in new tab) View (opens in new tab)
242 Too generic names (columns) (there is a column with a more specific name in the table) Find column names in case of which the same table has another column (with more specific name) that name contains the column name in the end or in the beginning. For instance, a base table has columns parent and root_parent and the former col-umn name is too generic, i.e., it should be more specific. Problem detection INFORMATION_SCHEMA+system catalog base tables MIT (opens in new tab) View (opens in new tab)
243 Grantable column privileges Find column privileges that the carrier of the privilege can in turn grant to others, i.e., the privileges have been given WITH GRANT OPTION. The number of privileges that can be passed on should be as small as possible. Problem detection INFORMATION_SCHEMA+system catalog base tables MIT (opens in new tab) View (opens in new tab)
244 Useless type indication Find columns and parameters where the type of the identifier is perhaps explicitly indicated in the name. Problem detection INFORMATION_SCHEMA+system catalog base tables MIT (opens in new tab) View (opens in new tab)
245 Useless type indication (2) Find columns and parameters where the type of the identifier is perhaps explicitly indicated in the name. Problem detection INFORMATION_SCHEMA+system catalog base tables MIT (opens in new tab) View (opens in new tab)
246 Empty columns Find columns in non-empty tables that do not contain any values. If there are no values in a columns, then it may mean that one hasn't tested constraints that have been declared to the column or implemented by using triggers. It could also mean that such columns are not needed at all. Problem detection INFORMATION_SCHEMA+system catalog base tables MIT (opens in new tab) View (opens in new tab)
247 Storing a duration rather than a point in time Find columns of base and foreign tables that based on the column names and types are used to register start time and duration rather than start time and end time. Problem detection INFORMATION_SCHEMA only MIT (opens in new tab) View (opens in new tab)
248 Storing a duration as time Find columns of base and foreign tables that based on the column names are used to register durations but the type of the column is time. "It is possible to use a TIME data type if the duration is less than 24 hours, but this is not what the type is intended for, and can be the cause of confusion for the next person who has to maintain your code." Problem detection INFORMATION_SCHEMA only MIT (opens in new tab) View (opens in new tab)
249 Full text search columns with other type of index than gin or gist index Find columns of base tabels and materialized views with the type tsvector that do not have a gin or a gist index but have another type of index (e.g., b-tree). Gin and Gist are the preferred index types for text search. Problem detection INFORMATION_SCHEMA+system catalog base tables MIT (opens in new tab) View (opens in new tab)
250 Full text search columns that have no gin or gist index Find columns of base tabels and materialized views with the type tsvector that do not have a gin or a gist index. These are the preferred index types for text search. Problem detection INFORMATION_SCHEMA+system catalog base tables MIT (opens in new tab) View (opens in new tab)
251 Preventing strings that consist of only spaces instead of strings that consist of only whitespace characters Find columns of base tables and foreign tables where one uses a check constraint to prevent values that consist of only spaces. Make sure that this is the correct constraint and there is no need to prevent values that consist of only whitespace characters. Problem detection INFORMATION_SCHEMA only MIT (opens in new tab) View (opens in new tab)
252 Columns with tsvector type Find columns of base tables and materialized views that have tsvector type. General INFORMATION_SCHEMA+system catalog base tables MIT (opens in new tab) View (opens in new tab)
253 Only one value permitted in a non-inherited base table or a foreign table column (based on check constraints) Find columns of base tables or foreign tables in case of which a check constraint on the column permits only one value in the column. Exclude columns that are inherited from a supertable because the constraint may be correct if it is applied to a column of a subtable that is inherited from the supertable. Problem detection INFORMATION_SCHEMA+system catalog base tables MIT (opens in new tab) View (opens in new tab)
254 Only one value permitted in a base table or a foreign table column (based on check constraints) Find columns of base tables or foreign tables in case of which a check constraint on the column permits only one value in the column. The constraint may be correct if it is applied to a column of a subtable that is inherited from the supertable or is used to enfore the rule that the table can have at most one row. General INFORMATION_SCHEMA+system catalog base tables MIT (opens in new tab) View (opens in new tab)
255 Only one value permitted in a base table or a foreign table column (based on enumeration types) Find columns of base tables or foreign tables in case of which the type of the column permits only one value in the column. The type is an enumeration type that specifies only one value. Problem detection INFORMATION_SCHEMA+system catalog base tables MIT (opens in new tab) View (opens in new tab)
256 Inappropriate field size or data type for column that strores database username Find columns of base tables that based on the default value of the column contain database username. However, the type of the column is not VARCHAR(63) or VARCHAR(128). Problem detection INFORMATION_SCHEMA only MIT (opens in new tab) View (opens in new tab)
257 Potentially missing PRIMARY KEY or UNIQUE constraints (based on sequence generators) Find columns of base tables that contain automatically generated unique values but do not belong to any PRIMARY KEY/UNIQUE constraint. If something has to be unique, then it must be said to the system so that it could use the information for internal optimizations and enforce the constraint. Problem detection INFORMATION_SCHEMA+system catalog base tables MIT (opens in new tab) View (opens in new tab)
258 Columns of base tables that hold truth values that do not have a default value although they could have it (non-Boolean columns) Find columns of base tables that do not have type BOOLEAN but are used to record Boolean values. Based on column names these implement a state machine or record agreements. At the same time the columns do not have a default value. There are only two truth values - TRUE and FALSE - in case of two-valued logic. It should be possible to select one of these as the default value of the column. Problem detection INFORMATION_SCHEMA+system catalog base tables MIT (opens in new tab) View (opens in new tab)
259 Perhaps incorrect default vale Find columns of base tables that have default value CURRENT_USER. Problem detection INFORMATION_SCHEMA only MIT (opens in new tab) View (opens in new tab)
260 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 (opens in new tab)