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...
661Perhaps 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
662Perhaps 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
663Perhaps 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
664Perhaps 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
665Perhaps 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
666Perhaps the type of a base table column should be BOOLEAN (based on column names)Find base table columns that based on the name seem to hold truth values. Find columns that name starts with "is_" or "has_" or "can_" or "on_" and that do not have Boolean type.Problem detectionINFORMATION_SCHEMA+system catalog base tables2024-01-03 09:41MIT License
667Perhaps the type of a base table column should be BOOLEAN (based on enumerated types)Find base table columns that have an enumerated type that seems to emulate Boolean type.Problem detectionINFORMATION_SCHEMA+system catalog base tables2021-02-25 17:30MIT License
668Perhaps 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
669Perhaps the type of a parameter should be BOOLEAN (based on parameter names)Find routine parameters that based on the name seem to hold truth values. Find parameters that name starts with "is_" or "has_" or "can_" or "on_" and that do not have Boolean type.Problem detectionINFORMATION_SCHEMA+system catalog base tables2024-01-03 00:10MIT License
670Perhaps too many different prefixes in the names of database objects that have the same typeOne should be consistent in naming, including in the use of prefixes. If you use prefix in the name of a database object, then it should refer to the type of the database object. Do not use different prefixes in the names of database objects that have the same type. Find types of database objects in case of which there are different prefixes in different names.Problem detectionINFORMATION_SCHEMA+system catalog base tables2023-03-18 17:16MIT License
671Perhaps too many different suffixes in the names of database objects that have the same typeOne should be consistent in naming, including in the use of suffixes. If you use sufix in the name of a database object, then it should refer to the type of the database object. Do not use different suffixes in the names of database objects that have the same type. Find types of database objects in case of which there are different suffixes in different names.Problem detectionINFORMATION_SCHEMA+system catalog base tables2023-03-17 11:14MIT License
672Perhaps too many input parametersToo many parameters (in this case four or more) could be a sign of not separating concerns and having a routine that has more than one task.Problem detectionINFORMATION_SCHEMA+system catalog base tables2021-11-04 10:57MIT License
673Perhaps too many square bracketsCharacter classes are surrounded by two pairs of square brackets.Problem detectionINFORMATION_SCHEMA+system catalog base tables2023-11-15 10:47MIT License
674Perhaps 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
675Perhaps Trim is missingFind derived tables (views and materialized views) that apparently concatenate values (by using || operator or use Concat function or use Format function) by putting a space between these but do not use Trim function to get rid of the extra space at the beginning or the end of the string.Problem detectionsystem catalog base tables only2023-12-13 13:53MIT License
676Perhaps unnecessary DECLARE section in a PL/pgSQL routineFind PL/pgSQL routines that perhaps unnecessarily contain DECLARE section. More specifically, find routines with the DECLARE section where the only task seems to be raising an exception. The query excludes the cases where the error message is constructed dynamically, i.e., in this case using a variable maybe justifiable.Problem detectionINFORMATION_SCHEMA+system catalog base tables2023-12-30 10:19MIT License
677Perhaps unnecessary DECLARE section in a PL/pgSQL routine (2)Find PL/pgSQL routines that perhaps unnecessarily contain DECLARE section. More specifically, find routines with the DECLARE section where the keyword DECLARE is followed by BEGIN, i.e., the DECLARE section is empty.Problem detectionINFORMATION_SCHEMA+system catalog base tables2023-12-23 13:39MIT License
678Perhaps unnecessary privileges to use the databaseFind as to whether a database user (except postgres), who is not a superuser, has Create (C) or Temporary (T) privileges to use the database.Problem detectionsystem catalog base tables only2021-11-23 20:42MIT License
679Perhaps updating of modification time is missingFind routines with SQL-standard body that seem to update data in a table that has a column for modification time but the routine does not seem to update the modification time while updating the row.Problem detectionINFORMATION_SCHEMA+system catalog base tables2023-11-24 12:59MIT License
680Perhaps USING syntax could be used for joining in the subqueries of derived tablesFind derived tables that use newer join syntax where join conditions are written in the WHERE clause but do not use USING synatx.Problem detectionINFORMATION_SCHEMA+system catalog base tables2023-11-10 14:14MIT License