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...
701Prefer Polymorphism to If/Else or Switch/CaseFind routines with IF/ELSE or SWITCH/CASE statements. If your routine has a multipart IF/CASE statement, then perhaps it has multiple tasks and it violates the separation of concerns and single responsibilities principles.Problem detectionINFORMATION_SCHEMA+system catalog base tables2023-11-29 13:31MIT License
702Prefer Polymorphism to If/Else or Switch/Case (2)Find routines with multiple raise exception commands. Perhaps it has multiple tasks and it violates the separation of concerns and single responsibilities principles.Problem detectionINFORMATION_SCHEMA+system catalog base tables2023-11-29 13:39MIT License
703Prefixes of base table namesFind base tables that name starts with a prefix. Do not use prefixes in case of base table names. Derive the names from the names of entity types. Do not use "_", "t_", "tab_", "t11_" etc as prefixes of a table.Problem detectionINFORMATION_SCHEMA only2022-11-15 16:32MIT License
704Preventing strings that consist of only spaces instead of strings that consist of only whitespace charactersFind columns of base tables and foreign tables where one uses a check constraint to prevent values that consist of only spaces. Make sure that this is the correct constraint and there is no need to prevent values that consist of only whitespace characters.Problem detectionINFORMATION_SCHEMA only2021-02-25 17:29MIT License
705Primary key columns are not the first in a tableIn SQL tables each column has the ordinal position. Find all the base tables where the primary key columns are not the first in the table, i.e., there is at least one non-primary key column that comes before a primary key column. It is easier to grasp the primary key if its columns are the first in the table. It could be that a table inherits from an abstract table where no keys have been defined.Problem detectionINFORMATION_SCHEMA+system catalog base tables2021-10-16 10:33MIT License
706Privileges on the database and its schemas, domains, types, languages, sequences, foreign data wrappers, and foreign servers that have been granted to a superuserFind privileges on the database and its schemas, domains, types, languages, sequences, foreign data wrappers, and foreign servers that have been granted to a superuser. Superuser can do anything in the database and thus does not need the privileges. The result is a sign that perhaps the executed GRANT statements were incorrect (wrong username) or the grantee later got superuser status (that it shouldn't have).Problem detectionsystem catalog base tables only2022-10-21 15:53MIT License
707Procedures cannot have START TRANSACTION and SAVEPOINTYou cannot use a START TRANSACTION or a SAVEPOINT statement in a procedure. Procedures appeared in PostgreSQL 11.Problem detectionINFORMATION_SCHEMA+system catalog base tables2021-11-04 11:50MIT License
708Publications with no tablesFind publications that do not contain any table.Problem detectionsystem catalog base tables only2021-02-25 17:30MIT License
709PUBLIC has TEMPORARY privilege in the databaseFind as to whether PUBLIC (all current and future users) has TEMPORARY privilege in the database. PUBLIC gets the privilege by default.Problem detectionsystem catalog base tables only2021-12-31 15:52MIT License
710PUBLIC has the USAGE privilege of a schemaFind schemas where PUBLIC has the usage privilege.Problem detectionINFORMATION_SCHEMA+system catalog base tables2021-11-23 17:52MIT License
711Reasonable upper bound to the length of textual values is missingFind non-foreign key base table columns that are not used to record comments/descriptions/explanations etc. and that have TEXT or VARCHAR type without restrictions to the field size (field size in case of VARCHAR or a CHECK constraint).Problem detectionINFORMATION_SCHEMA+system catalog base tables2021-12-16 12:32MIT License
712Recursive relationships with the same source and targetFind incorrectly implemented adjacency lists.Problem detectionsystem catalog base tables only2021-02-25 17:30MIT License
713Recursive rules that directly modify their home tableDo not cause potentially infinite loops. Recursive rules would fire itself over and over again. Although the system is able to detect these after executing a data modification statement it is better to avoid creating these altogether.Problem detectionsystem catalog base tables only2022-10-21 15:59MIT License
714Recursive triggers that directly modify their home tableDo not cause potentially infinite loops. Recursive trigger fire themselves over and over again. If the system is not able to stop these, then it eventually consumes all the resources of the system. Although the system is able to detect these it is better to avoid creating these altogether.Problem detectionINFORMATION_SCHEMA+system catalog base tables2021-02-25 17:30MIT License
715Redundant indexesFind indexes that may be redundant. In addition to identical indexes it also considers indexes that cover the same columns and have the same properties except uniqueness. The query considers all types of indexes, including indexes that have been automatically created to support a constraint and function-based indexes.Problem detectionsystem catalog base tables only2021-02-25 17:29MIT License
716Reference to the numeric type is too imprecise, i.e., precision and scale are missingFind base table columns that have the DECIMAL/NUMERIC type, but do not have precision and scale specified. "Specifying: NUMERIC without any precision or scale creates a column in which numeric values of any precision and scale can be stored, up to the implementation limit on precision. A column of this kind will not coerce input values to any particular scale, whereas numeric columns with a declared scale will coerce input values to that scale."Problem detectionINFORMATION_SCHEMA only2021-02-25 17:30MIT License
717Registration/modification time is not automatically setFind columns of base tables that name and type suggest that the column should contain the row registration time or last modify time but the column does not have a default value.Problem detectionINFORMATION_SCHEMA only2021-03-28 17:36MIT License
718Registration/modification time is not mandatoryFind columns that contain registration or modification time but are optional.Problem detectionINFORMATION_SCHEMA only2023-11-26 16:51MIT License
719Regular expression with possibly a LIKE patternFind expressions that use a regular expression with a like predicate pattern.Problem detectionINFORMATION_SCHEMA+system catalog base tables2023-10-21 11:11MIT License
720Routine body has keywords that are not in uppercaseKeywords in uppercase improve readability.Problem detectionINFORMATION_SCHEMA+system catalog base tables2023-12-24 17:06MIT License