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...
281Do 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
282Do 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
283Double checking of the maximum character lengthDo not duplicate code. In this case a CHECK constraint duplicates the restriction that is already enforced with the help of the declaration of the maximum field size (for instance, VARCHAR(100)).Problem detectionINFORMATION_SCHEMA+system catalog base tables2023-11-18 13:27MIT License
284Double negatives in Boolean expressionsWrite code that is simple to understand and not confusing. A double negative is a grammatical construction occurring when two forms of negation are used in the same expression (https://en.wikipedia.org/wiki/Double_negative). Double negatives in Boolean expressions make it more difficult to understand and maintain the code.Problem detectionINFORMATION_SCHEMA+system catalog base tables2021-02-25 17:29MIT License
285Double negatives in regular expressionsFing regular expression patterns that use [^\S] instead of \s or [^\D] instead of \d or [^\W] instead of \w.Problem detectionINFORMATION_SCHEMA+system catalog base tables2023-11-09 12:01MIT License
286Do 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
287Duplicate 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
288Duplicate 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
289Duplicate check of empty stringsFind columns that have a check that prevents the empty string in the column but there is already another check on the column that enforces the constraint. If there is a constraint description!~'^[[:space:]]*$', then it covers the constraint description!='' and the latter becomes redundant.Problem detectionINFORMATION_SCHEMA+system catalog base tables2021-12-19 15:08MIT License
290Duplicate commentsFind comments that have been registered with a COMMENT statement and that are associated with more than one object. It would probably mean that a comment is incorrect or missing.Problem detectionINFORMATION_SCHEMA+system catalog base tables2023-03-16 20:33MIT License
291Duplicate 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
292Duplicate domainsFind domains that have the same properties (base type, character length, not null + check constraints, default value). There should not be multiple domains that have the same properties. Do remember that the same task can be solved in SQL usually in multiple different ways. Therefore, the domains may have syntactically different check constraints that solve the same task. Thus, the exact copies are not the only possible duplication.Problem detectionINFORMATION_SCHEMA+system catalog base tables2021-02-25 17:30MIT License
293Duplicate enumerated typesFind enumerated types with exactly the same values. There should not be multiple types that have the same values.Problem detectionINFORMATION_SCHEMA+system catalog base tables2021-02-25 17:30MIT License
294Duplicate foreign key constraintsFind duplicate foreign key constraints, which involve the same columns and refer to the same set of columns.Problem detectionsystem catalog base tables only2021-02-25 17:30MIT License
295Duplicate independent (i.e., not created based on a table) composite typesFind composite types with the same attributes (regardless of the order of attributes). Make sure that there is no duplication.Problem detectionsystem catalog base tables only2021-02-25 17:29MIT License
296Duplicate keysFind completely overlapping key (primary key and unique) constraints. This is a form of duplication. It leads to the creation of multiple indexes to the same set of columns.Problem detectionsystem catalog base tables only2021-10-16 10:27MIT License
297Duplicate materialized viewsFind materialized views with exactly the same subquery. There should not be multiple materialized views with 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 detectionsystem catalog base tables only2021-02-25 17:30MIT License
298Duplicate non-fuction based unique indexesFind pairs of non-function based unique indexes that cover the same set of columns. Include indexes that support a constraint (primary key, unique, exclude), i.e., these indexes have been automatically created due to the constraint declaration. For instance, it helps us to find unique indexes that have been defined to already unique columns.Problem detectionsystem catalog base tables only2022-10-21 10:17MIT License
299Duplicate NOT NULL constraintsFind columns that have NOT NULL constraint through a domain and also directly. Do not duplicate NOT NULL constraints in orde to avoid confusion and surprises.Problem detectionINFORMATION_SCHEMA+system catalog base tables2021-02-25 17:30MIT License
300Duplicate removal of duplicates in derived tablesFind derived tables (views and materialized views) that contain both DISTINCT and GROUP BY. Make sure that the means for removing duplicate rows from the query result are not duplicated.Problem detectionINFORMATION_SCHEMA+system catalog base tables2021-02-25 17:29MIT License