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...
1CHECK constraints that perhaps do not consider 'infinity' and '-infinity' special valuesFind check constraints of base tables that cover exactly one column where the default value of the column is special value 'infinity' or '-infinity'. Find only such constraints that probably check a range of permitted values but do not consider that one of the values might be 'infinity' or '-infinity'. Such special values belong to the types DATE, TIMESTAMP, NUMERIC, REAL, and DOUBLE PRECISION.Problem detectionINFORMATION_SCHEMA+system catalog base tables2024-05-08 18:58MIT License
2Definition of a non-minimal superkey instead of a candidate key (based on check constraints)Candidate key is a minimal superkey, meaning that it is not possible to remove columns from the candidate key without losing its uniqueness property. One should define primary key's and unique constraints based on candidate keys. Find primary key and unique constraints where a proper subset of columns has a check constraint that permits only one value in the column. The candidate key should involve only columns without such constraint.Problem detectionINFORMATION_SCHEMA+system catalog base tables2024-04-30 20:25MIT License
3Only one value permitted in a non-inherited base table or a foreign table column (based on check constraints)Find columns of base tables or foreign tables in case of which a check constraint on the column permits only one value in the column. Exclude columns that are inherited from a supertable because the constraint may be correct if it is applied to a column of a subtable that is inherited from the supertable.Problem detectionINFORMATION_SCHEMA+system catalog base tables2024-04-30 20:16MIT License
4Only one value permitted in a base table or a foreign table column (based on check constraints)Find columns of base tables or foreign tables in case of which a check constraint on the column permits only one value in the column. The constraint may be correct if it is applied to a column of a subtable that is inherited from the supertable or is used to enfore the rule that the table can have at most one row.GeneralINFORMATION_SCHEMA+system catalog base tables2024-04-30 20:14MIT License
5YELLING IN COMMENTS!Find comments of derived tables and routines that consist of only uppercase letters. Do not use only uppercase (capital) letters in order to write comments. It means yelling and also makes text less readable.Problem detectionINFORMATION_SCHEMA+system catalog base tables2024-04-25 15:13MIT License
6The SQL-language routines with the body that is string literalFind SQL-language routines that have the body that is string literal, i.e., the body is not SQL-standard function body. Routines with a SQL-standard body are permitted starting from PostgreSQL 14.Problem detectionINFORMATION_SCHEMA+system catalog base tables2024-01-24 18:20MIT License
7Unbalanced bracketsWrite expressions correctly. Find code fragments that have unbalanced brackets, i.e., the number of opening brackets is not the same as the number of closing brackets.Problem detectionINFORMATION_SCHEMA+system catalog base tables2024-01-24 16:02MIT License
8Input parameters with the same name have different typesFind named input parameters of routines that have the same name but different type. It could be a mistake or deliberate due to overloading of routines.Problem detectionINFORMATION_SCHEMA+system catalog base tables2024-01-24 15:01MIT License
9Multiple deletes from the same table in a routineCode should be as compact as possible and system should make as little work as necessary in order to solve a task. Thus, instead of deleting different rows of the same table with different DELETE statements one should try to do it with one statement. The query excludes routines where IF statement is used.Problem detectionINFORMATION_SCHEMA+system catalog base tables2024-01-24 14:15MIT License
10Multiple updates of the same table in a routineCode should be as compact as possible and system should make as little work as necessary in order to solve a task. Thus, instead of updating different fields of the same table with different UPDATE statements one should try to do it with one statement.Problem detectionINFORMATION_SCHEMA+system catalog base tables2024-01-24 13:59MIT License
11Inconsistent use of older and newer join syntax in the subqueries of derived tablesFind as to whether the subqueries of derived tables use both older join syntax (join condition in the where clause) and newer syntax (join condition in the from clause).Problem detectionINFORMATION_SCHEMA+system catalog base tables2024-01-24 13:26MIT License
12Unused indexes (2)Find indexes that are not used by the DBMS. Remember that indexes are not a "free lunch" and they slow down the processes of updating data.Problem detectionINFORMATION_SCHEMA+system catalog base tables2024-01-19 00:28MIT License
13Unused indexesFind indexes that are not used by the DBMS. Remember that indexes are not a "free lunch" and they slow down the processes of updating data.Problem detectionINFORMATION_SCHEMA+system catalog base tables2024-01-19 00:23MIT License
14The number of routines by the number of input parametersFind the number of user-defined non-trigger routines by the number of input parameters.Sofware measureINFORMATION_SCHEMA+system catalog base tables2024-01-16 09:43MIT License
15The number of user-defined routines based on their database usageFind the number of non-extension routines in a database that modify data. The routines can be used to implement virtual data layer. Thus the queriy gives some indications about the possible extent of the layer. The query distinguishes trigger and non-trigger routines, thus it also gives information about triggers that modify data.Sofware measureINFORMATION_SCHEMA+system catalog base tables2024-01-15 00:38MIT License
16The number of user-defined non-trigger routines by schema, by language, and by routine typeFind the number of user-defined non-trigger routines based on their schema, language, and routine type. The routines can be used to implement virtual data layer. Thus the queriy gives some indications about the possible extent of the layer.Sofware measureINFORMATION_SCHEMA+system catalog base tables2024-01-14 20:53MIT License
17The number of user-defined non-trigger routines by schema, by security type, and by being deterministicFind the number of user-defined non-trigger routines based on their schema, security type, and being deterministic. The routines can be used to implement virtual data layer. Thus the queriy gives some indications about the possible extent of the layer.Sofware measureINFORMATION_SCHEMA+system catalog base tables2024-01-14 20:52MIT License
18The number of commented routinesFind the number of commented routines based on the way how the comments have been added (as a COMMENT object or as a comment in the routine body).Sofware measureINFORMATION_SCHEMA+system catalog base tables2024-01-14 20:49MIT License
19The number of user defined triggers by different characteristicsFind the number of user defined triggers by action orientation (ROW, STATEMENT), action timing (BEFORE, AFTER, INSTEAD OF), and event type (INSERT, UPDATE, DELETE) and their combinations.Sofware measureINFORMATION_SCHEMA only2024-01-14 17:41MIT License
20Updatable views with WHERE clause that do not have WITH CHECK OPTION constraintFind updatable views that restrict rows, i.e., have WHERE clause, but do not have WITH CHECK OPTION constraint. WITH CHECK OPTION constraint prevents updates through the view that violate the predicate of the view. Such updates must be prevented.Problem detectionINFORMATION_SCHEMA only2024-01-14 17:11MIT License