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...
1YELLING 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
2The 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
3Unbalanced 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
4Input 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
5Multiple 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
6Multiple 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
7Inconsistent 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
8Unused 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
9Unused 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
10The 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
11The 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
12The 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
13The 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
14The 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
15The 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
16Updatable 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
17All updatable viewsFind all views through which it is possible to modify data in base tables. Is_insertable_into and is_updatable show as to whether the view is naturally updatable in PostgreSQL or has associated rules that make sure that INSERT/UPDATE/DELETE operations against the view will not cause an error. Please note that the rule could be DO INSTEAD NOTHING rule, i.e., data modification through the view does not cause an error but the data is not actually modified. If the updatability is achieved due to rules, then is_updatable=YES if the view has both UPDATE and DELETE rule that make sure that UPDATE and DELETE operations do not cause an error.GeneralINFORMATION_SCHEMA only2024-01-14 17:09MIT License
18Different tasks of rulesFind different tasks that are solved by using rules, i.e., different rules on the same table or different tables that do the same thing are considered to solve one task.Generalsystem catalog base tables only2024-01-14 16:10MIT License
19The number of rules by different characteristicsFind the number of rules by event (SELECT, INSERT, UPDATE, and DELETE) and in total.Sofware measuresystem catalog base tables only2024-01-14 16:10MIT License
20Number of used tablesFind statistics about how many derived tables have how many different underlying tables.Sofware measureINFORMATION_SCHEMA+system catalog base tables2024-01-14 13:43MIT License