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...
141Perhaps the type of a base table column/domain should be numeric (based on default values)Specify for each column/domain a right data type that takes into account expected values in the column/domain. Find base table columns and domains that have a textual type but the default value that represents a number (for instance, '100', '2', or '0.22'). Exclude columns about formats.Problem detectionINFORMATION_SCHEMA only2023-12-30 10:59MIT License
142Perhaps the type of a base table column/domain should be temporal (based on default values)Find base table columns and domains that have a textual type but the default value that represents a temporal value (either a static value or invocation of a function that returns such value). Specify for each column/domain a right data type that takes into account expected values in the column/domain.Problem detectionINFORMATION_SCHEMA only2021-02-25 17:30MIT License
143Perhaps the type of a base table column/domain should be temporal (deadlines)Find base table columns that name refers to the possibility that there are registered deadlines but the column does not have a temporal type.Problem detectionINFORMATION_SCHEMA only2021-03-21 17:00MIT License
144Perhaps the type of a base table column/domain should be VARCHAR (based on column names)Find base table columns that have CHAR type, where character maximum length is bigger than 1 and the name of the column does not refer to the possibility that the column holds some kind of codes or flags or hash values.Problem detectionINFORMATION_SCHEMA only2023-11-12 10:48MIT License
145Perhaps 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
146Perhaps the type of a base table column should be XML, JSON, or JSONB (based on column names)Find base table columns that name refers to the possibility that these are used to register XML/JSON values. Find the columns that do not have an appropriate data type (xml, json, jsonb). One shouldn't use columns with a textual type to register such data.Problem detectionINFORMATION_SCHEMA only2021-03-28 15:30MIT License
147Perhaps too many subconditions in a CHECK constraintFind check constraints of base table and foreign table columns that are either associated with more than one column and have at least one AND operation or are associated with exactly one column and have two or more AND operations.Problem detectionINFORMATION_SCHEMA only2024-01-01 12:23MIT License
148Permitting in a column only empty strings and strings that consist of whitespace charactersFind table CHECK constraints that permit in a column only empty strings or strings that consist of only whitespace characters.Problem detectionINFORMATION_SCHEMA only2021-12-19 15:10MIT License
149Phone number column has an incorrect data typeFind the columns where the name reffers to the possibility that the column contains phone numbers but the type of the column is not VARCHAR or TEXT.Problem detectionINFORMATION_SCHEMA only2021-03-27 19:00MIT License
150Potential duplication of sequence generatorsDo not create unnecessary sequence generators.Problem detectionINFORMATION_SCHEMA only2022-11-21 11:01MIT License
151Potentially missing default values of base table columnsFind columns of base tables without a default value that are either Boolean columns that based on the name seem to implement a state machine or temporal columns that based on the name seem to keep registration or update time. These columns often have a default value.Problem detectionINFORMATION_SCHEMA only2023-11-15 17:03MIT License
152Potentially unused sequence generatorsFind sequence generators that are not associated with any column through the default value mechanism. Please note, that it is also possible to refer to a sequence generator from a routine or from an application. If these are indeed not used, then these should be dropped, otherwise these are dead code.Problem detectionINFORMATION_SCHEMA only2021-03-07 20:56MIT License
153Precision of a timestamp or a time column is too bigFind columns with a timestamp or a time type where the precision (the permitted maximum number of fractional sections) is bigger than the precision in the default value of the column.Problem detectionINFORMATION_SCHEMA only2023-11-02 17:29MIT License
154Prefixes of base table namesFind base tables that name starts with a prefix. Do not use prefixes in case of base table names. Derive the names from the names of entity types. Do not use "_", "t_", "tab_", "t11_" etc as prefixes of a table.Problem detectionINFORMATION_SCHEMA only2022-11-15 16:32MIT License
155Preventing 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
156Publicly accessible system catalog tablesFind privileges to use system catalog base tables or views that have been granted to public.GeneralINFORMATION_SCHEMA only2023-11-24 14:56MIT License
157Reference to the numeric type is too imprecise, i.e., precision and scale are missingFind base table columns that have the DECIMAL/NUMERIC type, but do not have precision and scale specified. "Specifying: NUMERIC without any precision or scale creates a column in which numeric values of any precision and scale can be stored, up to the implementation limit on precision. A column of this kind will not coerce input values to any particular scale, whereas numeric columns with a declared scale will coerce input values to that scale."Problem detectionINFORMATION_SCHEMA only2021-02-25 17:30MIT License
158Referential degree of a schemaReferential degree of a schema is defined as the number of foreign keys in the database schema.Sofware measureINFORMATION_SCHEMA only2020-11-13 11:30MIT License
159Referential degree of tablesThis metric represents the number of foreign keys in a base table.Sofware measureINFORMATION_SCHEMA only2021-03-12 11:07MIT License
160Registration/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