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...
121A state machine is implemented with the help of an enumeration typeFind implementations of state machines that uses an enumeration type.Problem detectionINFORMATION_SCHEMA+system catalog base tables2023-11-26 15:39MIT License
122A state machine is implemented with the help of a state classifier tableFind implementations of state machines that use a state classifier table.Generalsystem catalog base tables only2023-11-26 15:39MIT License
123Publicly accessible system catalog tablesFind privileges to use system catalog base tables or views that have been granted to public.GeneralINFORMATION_SCHEMA only2023-11-24 14:56MIT License
124Derived table uses a function to get data from another tableFind views that use a function to get data from another table.Problem detectionINFORMATION_SCHEMA+system catalog base tables2023-11-24 14:36MIT License
125Invocation of PL/pgSQL functions from the subqueries of derived tablesFind derived tables that subqueries invoke a PL/pgSQL function. Avoid context switch that is caused by the invocation of PL/pgSQL functions from the subqueries of derived tables.Problem detectionINFORMATION_SCHEMA+system catalog base tables2023-11-24 14:30MIT License
126Perhaps 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
127Incorrect specification of logical or in regular expressionsFind the use of regular expressions where logical or is incorrectly specified, i.e., (| or |).Problem detectionINFORMATION_SCHEMA+system catalog base tables2023-11-24 12:07MIT License
128A predefine character class has been incorrectly specifiedFind regular expressions where a predefined character class is incorrectly specified, e.g. [digit] instead of [:digit:].Problem detectionINFORMATION_SCHEMA+system catalog base tables2023-11-23 12:09MIT License
129Predefined character classes must be between double square bracketsFind regular expressions that do not have predefined character classes between double square brackets, e.g., [:digit:] instead of [[:digit:]].Problem detectionINFORMATION_SCHEMA+system catalog base tables2023-11-22 17:34MIT License
130Views without security barrierFind views that do not have the security barrier option.Problem detectionINFORMATION_SCHEMA+system catalog base tables2023-11-22 12:05MIT License
131Trigger functions with a conditional statementFind trigger functions that contain a conditional (IF or CASE) but do not contain a SELECT statement before these. The latter condition is for the reason that one cannot use a subquery in the WHEN clause. Thus, if one wants to make a query and decide the further action based on the results of the query, then one must do it within the body of the function.Problem detectionINFORMATION_SCHEMA+system catalog base tables2023-11-19 12:07MIT License
132Inappropriate 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
133Perhaps spaces are unnecessarily restrictedFind base table columns that name refers to the possibility that the column is used to record names or textual descriptions but the column seems to have a simple check constraint that restricts spaces in these.Problem detectionINFORMATION_SCHEMA+system catalog base tables2023-11-18 13:30MIT License
134Double 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
135All security policiesFind all security policies.Generalsystem catalog base tables only2023-11-17 18:41MIT License
136Views with unnecessary security invokerFind views with security invoker option that do not have any underlying base table with a security policy. Security invoker option of views is possible starting from PostgreSQL 15. "The main use case (and the one that inspired the feature) is to be able to use views and still check row-level security policies on the underlying tables as the invoker."Problem detectionINFORMATION_SCHEMA+system catalog base tables2023-11-17 18:39MIT License
137Optional foreign key columnsFind foreign key columns that do not have the NOT NULL constraint. It is better to limit the use of NULLs and optional columns due to the problems that it causes in interpreting the query results, making queries, and enforcing constraints. In addition, one should check as to whether this kind of design is consistent with the multiplicities in the conceptual data model.GeneralINFORMATION_SCHEMA only2023-11-17 18:36MIT License
138Potentially missing PRIMARY KEY or UNIQUE constraints (based on column names)Find columns of base tables that name refers to the possibility that it contains unique values but the column does not belong to any PRIMARY KEY/UNIQUE constraint. If something has to be unique, then it must be said to the system so that it could use the information for internal optimizations and enforce the constraint.Problem detectionINFORMATION_SCHEMA+system catalog base tables2023-11-17 18:09MIT License
139Surrogate key columns that do not follow the naming styleFind surrogate key columns that name does not end with "id_" or start with "id_".Problem detectionINFORMATION_SCHEMA+system catalog base tables2023-11-16 12:19MIT License
140ON UPDATE CASCADE is probably missing (based on column names)Find foreign key constraints that do not feature ON UPDATE CASCADE compensating action although people have a reason to change the key value in the primary table by assuming that the names of foreign key columns correctly point towards the use of natural keys in the table.Problem detectionsystem catalog base tables only2023-11-16 11:59MIT License