Catalog of PostgreSQL queries for finding information about a PostgreSQL database and its design problems

AND
AND
AND
ANDFrom where does the query gets its information?
AND
AND

There are 961 queries.

Seq nrNameGoalTypeData sourceLast updateLicense...
281Full text search columns with other type of index than gin or gist indexFind 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 detectionINFORMATION_SCHEMA+system catalog base tables2023-11-07 09:22MIT License
282Full text search columns that have no gin or gist indexFind 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 detectionINFORMATION_SCHEMA+system catalog base tables2023-11-07 09:22MIT License
283Preventing strings that consist of only spaces instead of strings that consist of only whitespace charactersFind 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 detectionINFORMATION_SCHEMA only2021-02-25 17:29MIT License
284Incorrect prevention of the empty string or strings that consist of only spaces in a fieldFind columns of base tables and foreign tables where the requirement that there should not be empty strings or strings that consist of only spaces in the column has been implemented incorrectly - by using the constraint trim(column_name) IS NOT NULL. PostgreSQL (differently from Oracle) does not replace the empty string with NULL. Empty string is a value but NULL is a special marker that denotes a missing value. Thus, in case of such constraint the DBMS checks a proposition '' IS NOT NULL. This is a true proposition and the DBMS does not prevent registration of such a row.Problem detectionINFORMATION_SCHEMA only2021-02-25 17:29MIT License
285Columns with tsvector typeFind columns of base tables and materialized views that have tsvector type.GeneralINFORMATION_SCHEMA+system catalog base tables2023-12-22 12:41MIT License
286Only 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 detectionINFORMATION_SCHEMA+system catalog base tables2024-04-30 20:16MIT License
287Only 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.GeneralINFORMATION_SCHEMA+system catalog base tables2024-04-30 20:14MIT License
288Only 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 detectionINFORMATION_SCHEMA+system catalog base tables2021-02-25 17:30MIT License
289Inappropriate field size or data type for column that strores database usernameFind 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 detectionINFORMATION_SCHEMA only2023-11-19 11:58MIT License
290Potentially 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 detectionINFORMATION_SCHEMA+system catalog base tables2021-03-07 20:53MIT License
291Columns 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 detectionINFORMATION_SCHEMA+system catalog base tables2023-11-09 16:40MIT License
292Perhaps incorrect default valeFind columns of base tables that have default value CURRENT_USER.Problem detectionINFORMATION_SCHEMA only2023-12-30 11:32MIT License
293Incorrect 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 detectionINFORMATION_SCHEMA only2023-12-30 11:06MIT License
294Incorrect field size (based on default values)Find columns of base tables that have the default value CURRENT_USER or SESSION_USER but the field size is not 63 (default maximum identifier length in PostgreSQL).Problem detectionINFORMATION_SCHEMA only2023-12-30 11:05MIT License
295Perhaps incorrect column name (based on default values)Find columns of base tables that have the default value CURRENT_USER or SESSION_USER but the name of the column does not refer to the fact that it contains usernames.Problem detectionINFORMATION_SCHEMA only2024-01-01 12:14MIT License
296Columns of base tables that hold truth values that do not have a default value although they could have it (Boolean columns)Find columns of base tables that have type BOOLEAN. 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 detectionINFORMATION_SCHEMA only2023-11-09 16:39MIT License
297Columns of base tables that hold truth values but do not have a default value (Boolean columns)Find columns of base tables that have type BOOLEAN but do not have a default value. There are only two truth values - TRUE and FALSE - in case of two-valued logic. Often it should be possible to select one of these as the default value of a column that has BOOLEAN type.Problem detectionINFORMATION_SCHEMA only2023-11-09 13:14MIT License
298Registration/modification time is not automatically setFind columns of base tables that name and type suggest that the column should contain the row registration time or last modify time but the column does not have a default value.Problem detectionINFORMATION_SCHEMA only2021-03-28 17:36MIT License
299Potentially missing PRIMARY KEY or UNIQUE constraints (based on column names)Find columns of base tables that name refers to the possibility that it contains unique values but the column does 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 detectionINFORMATION_SCHEMA+system catalog base tables2023-11-17 18:09MIT License
300Perhaps the type of a base table column should be an integer type (based on column names)Find columns of base tables where the name of the column has prefix or suffix "id" or has the name "id" but the column does not have an integer type or uuid type. A convention is to use the phrase "id" in the names of surrogate key columns.Problem detectionINFORMATION_SCHEMA only2023-11-08 13:31MIT License