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...
121Optional base table columnsFind optional base table columns, i.e., columns that permit NULLs. Are you sure you want to allow NULLs in these columns?GeneralINFORMATION_SCHEMA only2020-11-21 03:02MIT License
122Optional base table columns that have a default value that is not the empty stringFind optiona base table columns that have a default value that is not the empty string. Such columns should be mandatory.Problem detectionINFORMATION_SCHEMA only2021-02-25 17:29MIT License
123Optional columns before mandatory columnsFind cases where optional columns are before a mandatory column. Place mandatory columns before optional columns to improve comprehensibility of the table.Problem detectionINFORMATION_SCHEMA only2021-02-25 17:29MIT License
124Optional foreign key columnsFind foreign key columns that do not have the NOT NULL constraint. It is better to limit the use of NULLs and optional columns due to the problems that it causes in interpreting the query results, making queries, and enforcing constraints. In addition, one should check as to whether this kind of design is consistent with the multiplicities in the conceptual data model.GeneralINFORMATION_SCHEMA only2023-11-17 18:36MIT License
125Pairs of base tables that have at least two columns with the same names and data typesWhat are the pairs of base tables that have at least two columns with the same names and data types. The tables might violate the principle of orthogonal design and hence might facilitate uncontrolled data redundancy over different tables.Problem detectionINFORMATION_SCHEMA only2022-11-09 13:13MIT License
126Percentage of optional columns in each base tableWhat is the percentage of optional columns (that permit NULLs) in case of each base table? It is better to prohibit the use of NULLs in as many columns as possible. Otherwise the results of queries may be misleading.Sofware measureINFORMATION_SCHEMA only2020-11-08 20:55MIT License
127Perhaps an unnecessary default value (the empty string or a string that consists of only whitespace) of a base table column/domainFind table columns and domains with the default value that is the empty string or a string that consists of only whitespace (for instance, newlines, spaces).Problem detectionINFORMATION_SCHEMA only2021-03-20 11:42MIT License
128Perhaps a redundant column (based on sequence generators)Find base tables where more than one column gets the default value by using the sequence generator mechanism.Problem detectionINFORMATION_SCHEMA only2021-03-05 09:42MIT License
129Perhaps a state machine is implemented with timestamp columnsFind implementations of state machines that uses a set of columns with a timestamp type.Problem detectionINFORMATION_SCHEMA only2021-03-26 21:04MIT License
130Perhaps a too simplified state machineFind base table columns with Boolean type that name refers to the possibility that these are used to register as to whether an entity is currently in active state or not. Find the base tables that have exactly one Boolean column. During the system design one should find all the possible states of an entity type that influence the behavior of the information system. Data as to whether an entity is in one of these states should be in the database. Having only two states - active/inactive - is sometimes a too big simplification.Problem detectionINFORMATION_SCHEMA only2021-03-27 03:08MIT License
131Perhaps checking of file extension is incorrectFind check constraints of tables that use a regular expression to check as to whether a registered string ends with an appropriate file extension. However, the expression does not put the dot sign into the square brackets nor does have the escape character \before it, i.e., it is interpreted as a single character not as the dot sign in the expression. In regular expressions the dot (.) matches any single character except the newline character.Problem detectionINFORMATION_SCHEMA only2023-11-08 15:29MIT License
132Perhaps default value 'infinity' is missingFind optional base table columns that have a timestamp type and do not have a default value.Problem detectionINFORMATION_SCHEMA only2023-11-12 11:52MIT License
133Perhaps 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
134Perhaps incorrect default valeFind columns of base tables that have default value CURRENT_USER.Problem detectionINFORMATION_SCHEMA only2023-12-30 11:32MIT License
135Perhaps incorrect WHEN clauseFind row level triggers that have action condition (WHEN clause) but the Boolean expression in its specifications does not refer to neither NEW nor OLD variable.Problem detectionINFORMATION_SCHEMA only2021-02-25 17:30MIT License
136Perhaps IS DISTINCT FROM should be used instead of <> in WHEN clausesUse a right predicate in trigger condition in order to ensure that the trigger executes always when it has to but not more often. IS DISTINCT FROM treats NULL as if it was a known value, rather than unknown. It would be relevant if a column that is referenced in the action condition is optional, i.e., permits NULLs.GeneralINFORMATION_SCHEMA only2020-12-24 14:30MIT License
137Perhaps the column type should be UUIDFind base table columns that do not have uuid type but the name of the column refers to the possibility that the values in the column are uuid's.Problem detectionINFORMATION_SCHEMA only2022-06-09 15:07MIT License
138Perhaps the precision in case of a base table column with NUMERIC/DECIMAL type is too smallMake sure that in case of using the type DECIMAL/NUMERIC as the type of a base table column the precision (the permitted number of digits in the number) is not too small. For instance, the biggest value in the type NUMERIC(1,1) is 0.9.Problem detectionINFORMATION_SCHEMA only2021-02-25 17:29MIT License
139Perhaps the type of a base table column/domain should be BOOLEAN (based on types and default values)Find base table columns and domains that have a textual type and the default value that represents a truth-value. For instance, the type of a column could be VARCHAR and the column has the default value 'TRUE'.Problem detectionINFORMATION_SCHEMA only2021-02-25 17:30MIT License
140Perhaps the type of a base table column/domain should be INTEGER/SMALLINT/BIGINT (based on sequence generators)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 refer to the nextval function by using the default value mechanism but do not have the type INTEGER, SMALLINT, or BIGINT. This check is performed in case of identity columns: ERROR: identity column type must be smallint, integer, or bigint.Problem detectionINFORMATION_SCHEMA only2021-03-04 11:24MIT License