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...
101Inconsistent data type usage in case of registering sums of moneyFind as to whether both the numeric type and integer types are used in case of columns that are meant for register data about prices.Problem detectionINFORMATION_SCHEMA only2021-03-21 18:32MIT License
102Inconsistent field sizes of columns for addressesFind as to whether columns for holding e-mail addresses, phone numbers, ip addresses, zip codes, ordinary addresses, or file addresses have inconsistent field sizes across tables.Problem detectionINFORMATION_SCHEMA only2023-11-01 12:53MIT License
103Inconsistent means to calculate tsvector valuesFind as to whether in the database there are multiple ways to calculate tsvector values, i.e., by using a generated column and by not using a generated column.Problem detectionINFORMATION_SCHEMA only2023-11-07 11:35MIT License
104Inconsistent precision and scale usage in case of registering sums of moneyFind as to whether different precisions/scales are used in case of registering data about sums of money in different columns.Problem detectionINFORMATION_SCHEMA only2021-03-29 13:07MIT License
105Inconsistent time zone and precision usage in case of registering timesFind as to whether different data types (with and without timezone) and precisions are used in case of registering times in different columns.Problem detectionINFORMATION_SCHEMA only2023-11-04 12:30MIT License
106Inconsistent time zone and precision usage in case of registering timestampsFind as to whether different data types (with and without timezone) and precisions are used in case of registering timestamps in different columns.Problem detectionINFORMATION_SCHEMA only2023-11-04 12:28MIT License
107Incorrect 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
108Incorrect 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
109Incorrect 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
110Incorrect use of non-deterministic functions in CHECK constraintsDo not create a constraint in case of which data that satisfied a constraint c at the registration time suddenly does not satisfy it any more as the time goes by. Find all the check constraints that use non-deterministic functions (now, current_timestamp, localtimestamp, current_date, current_time) in a way that makes this situation possible. Fort instance, localtimestamp(0)>end_date is an example of such constraint.Problem detectionINFORMATION_SCHEMA only2023-11-29 14:59MIT License
111Insufficient number of user-defined base tablesThere must be at least n (seven in this case) user-defined base tables in the database.Problem detectionINFORMATION_SCHEMA only2021-02-25 17:30MIT License
112Insufficient number of user-defined domainsThere must be at least n (one in this case) user-defined domains in the database each of that must be used in case of at least two columns of base tables.Problem detectionINFORMATION_SCHEMA only2021-02-25 17:30MIT License
113Insufficient number of user-defined foreign tablesThere must be at least n (two in this case) user-defined foreign tables in the database.Problem detectionINFORMATION_SCHEMA only2021-02-25 17:30MIT License
114Insufficient number of user-defined viewsThere must be at least n (four in this case) user-defined views in the database.Problem detectionINFORMATION_SCHEMA only2021-02-25 17:30MIT License
115IS NULL check is probably not neededFind CHECK constraints that refer only to mandatory columns but the Boolean expression has IS NULL condition.Problem detectionINFORMATION_SCHEMA only2022-06-09 13:57MIT License
116JSON type instead of JSONB type"In general, most applications should prefer to store JSON data as jsonb, unless there are quite specialized needs, such as legacy assumptions about ordering of object keys." (https://www.postgresql.org/docs/current/datatype-json.html)Problem detectionINFORMATION_SCHEMA only2021-02-25 17:30MIT License
117Mixing different mechanisms to generate surrogate valuesUse the same mechanism of generating surrogate key values throughout the database. The use of SERIAL notation/explicitly creating a sequence generator and declaration of a column as an identity column will cause the creation of an external and internal sequence generator, respectively. Nevertheless, one should try to stick with using one of the mechanisms in order to cause less confusion. "If you do something a certain way, do all similar things in the same way." (Robert C. Martin, Clean Code)Problem detectionINFORMATION_SCHEMA only2021-03-08 00:42MIT License
118Mixing the use of TEXT and VARCHAR type in case of base table columnsDeclaring a column to have the type TEXT or the type VARCHAR (without the maximum number of characters) has the same end result in terms of what data can be recorded in the column. Nevertheless, one should try to stick with using one of the type names in order to cause less confusion. "If you do something a certain way, do all similar things in the same way." (Robert C. Martin, Clean Code)Problem detectionINFORMATION_SCHEMA only2021-03-12 15:06MIT License
119Multiple columns in the same base table that are associated with a sequence generatorFind base tables where multiple columns are associated with a sequence generator. Do not create unnecessary sequence generators. If one uses in a table a surrogate key, then it is enough to have one column where the values are generated by using a (external or internal) sequence generator.Problem detectionINFORMATION_SCHEMA only2021-03-08 00:41MIT License
120Non-foreign key columns that have no associated CHECK constraintsFind what are the base table columns that are not foreign key columns and that have no associated CHECK constraints? Perhaps some CHECK constraints are missing.Problem detectionINFORMATION_SCHEMA only2021-02-25 17:29MIT License