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...
81Do not use FLOAT Data TypeFind base table columns that have FLOAT, REAL, or DOUBLE PRECISION type. "The data types real and double precision are inexact, variable-precision numeric types. On all currently supported platforms, these types are implementations of IEEE Standard 754 for Binary Floating-Point Arithmetic (single and double precision, respectively), to the extent that the underlying processor, operating system, and compiler support it." (PostgreSQL documentation) Do not use the approximate numeric types FLOAT, REAL, and DOUBLE PRECISION in order to present fractional numeric data. Due to the use of the IEEE 754 standard the results of calculations with the values, which have one of these types, can be inexact because out of necessity some numbers must be rounded to a value, which is very close. "Comparing two floating-point values for equality might not always work as expected." (PostgreSQL documentation)Problem detectionINFORMATION_SCHEMA only2021-03-12 15:41MIT License
82Do not use the money data typeFind base table columns with the Money data type. Each value of the money type has associated currency sign that depends on server settings. It could be $. Moreover, using the values for arithmetic operations requires casts that makes the code more complicated.Problem detectionINFORMATION_SCHEMA only2021-02-25 17:29MIT License
83Do you really need fractional seconds?Find default values that return current timestamp with the maximum number of fractional seconds (6).Problem detectionINFORMATION_SCHEMA only2021-02-25 17:29MIT License
84Duplicate CHECK constraints that are connected directly to a tableThe same table should not have multiple CHECK constraints with exactly the same Boolean expression. Do remember that the same task can be solved in SQL usually in multiple different ways. Thus, the exact copies are not the only possible duplication.Problem detectionINFORMATION_SCHEMA only2021-02-25 17:30MIT License
85Duplicate CHECK constraints that are connected to a domainThe same domain should not have multiple CHECK constraints with exactly the same Boolean expression. Do remember that the same task can be solved in SQL usually in multiple different ways. Thus, the exact copies are not the only possible duplication.Problem detectionINFORMATION_SCHEMA only2021-02-25 17:30MIT License
86Duplicate DEFAULT values of base table columnsFind base table columns that have both default value determined through a domain and default value that is directly attached to the column. Do not duplicate specifications of default values to avoid confusion and surprises. If column and domain both have a default value, then in case of inserting data the default value that is associated directly with the column is used.Problem detectionINFORMATION_SCHEMA only2021-02-25 17:30MIT License
87Duplicate stored generated base table columnsFind base tables that have more than one stored generated column with the same expression. The support of generated columns was added to PostgreSQL 12. Do remember that the same task can be solved in SQL usually in multiple different ways. Thus, the exact copies are not the only possible duplication.Problem detectionINFORMATION_SCHEMA only2021-02-25 17:30MIT License
88Duplicate viewsFind views with exactly the same subquery. There should not be multiple views with exactly the same subquery. Do remember that the same task can be solved in SQL usually in multiple different ways. Thus, the exact copies are not the only possible duplication.Problem detectionINFORMATION_SCHEMA only2021-02-25 17:30MIT License
89Field size is not sufficiently different in case of base table columnsFind base table columns that name refers to the possibility that these are used to register names. Find base table columns that name refers to the possibility that these are used to register comments/descriptions/etc. Find the cases where a base table contains columns from the both sets and the field size in case of the latter is not at least twice as big as in case of the former. For example, if the name of a service can be 100 character long, then it is quite illogical that the description of the service is only at most 200 characters long.Problem detectionINFORMATION_SCHEMA only2021-03-27 18:51MIT License
90Generated stored base table columnsFind generated stored columns in PostgreSQL base tables. The support of generated columns was added to PostgreSQL 12. These could be used to improve the performance of queries.GeneralINFORMATION_SCHEMA only2020-11-06 14:51MIT License
91Generated stored base table columns duplicates another column in the tableFind generated stored columns in PostgreSQL base tables that duplicate other columns in the table.Problem detectionINFORMATION_SCHEMA only2021-02-25 17:30MIT License
92Generated stored base table columns that expression does not refer to any columnFind generated stored base table columns that expression does not refer to any column of the table. It could be that there will be a constant value in every row in case of this column. The support of generated columns was added to PostgreSQL 12.Problem detectionINFORMATION_SCHEMA only2021-02-25 17:29MIT License
93GranteesDatabase must be used by users who have minimal set of privileges for performing tasks. The query helps to find out as to whether some user/role other than PUBLIC and a superuser have rights to use tables and routines of the database.GeneralINFORMATION_SCHEMA only2020-11-06 14:51MIT License
94Inappropriate 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
95Inconsistency between the name and the type of a base table column (dates)Find base table columns that name refers to the possibility that these are used to register dates. Find the columns that do not have an appropriate data type. Column names should reflect the data that is possible to record in the column. For instance, in case of temporal data the column name should indicate as to whether we record dates or timestamps. If the column data type is "date", then the suffix of the column name should be "kp" (Estonian) or "date" (English).Problem detectionINFORMATION_SCHEMA only2021-03-27 16:16MIT License
96Inconsistency between the name and the type of a base table column (timestamps)Find base table columns that name refers to the possibility that these are used to register timestamps. Find the columns that do not have an appropriate data type. Column names should reflect the data that is possible to record in the column. For instance, in case of temporal data the column name should indicate as to whether we record dates or timestamps. If the column type is "timestamp", then the suffix of the column name should be "aeg" (Estonian) or "time" (English).Problem detectionINFORMATION_SCHEMA only2021-03-28 15:12MIT License
97Inconsistency between the type and the default value of a column (date and timestamp values)Find table columns with timestamp/date types that data type and dynamically found default value have a different type.Problem detectionINFORMATION_SCHEMA only2021-02-25 17:29MIT License
98Inconsistency between the type and the default value of a column (time values)Find table columns with time types, which data type and dynamically found default value have a different type.Problem detectionINFORMATION_SCHEMA only2021-02-25 17:29MIT License
99Inconsistent data type usage in case of registering a dateFind as to whether there are multiple different types used in case of columns that are meant for registering dates.Problem detectionINFORMATION_SCHEMA only2021-03-21 18:32MIT License
100Inconsistent data type usage in case of registering a symbolFind whether the database uses both CHAR(1) and VARCHAR(1) columns to register a single symbol.Problem detectionINFORMATION_SCHEMA only2021-02-25 17:30MIT License