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...
721The 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
722The 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
723The 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
724The use of xmin hidden column in views and routinesFind the number of views and materialized views that have a column with the xid type and the number of routines that contain a UPDATE or a DELETE statement that search condition refers to the xmin column. If one uses optimistic approach for dealing with the concurrent modifications of data, then xmin values should be presented by views and used in routines that modify or delete rows.Sofware measureINFORMATION_SCHEMA+system catalog base tables2021-11-04 11:56MIT License
725Number of views with and without security barrierFind the number of views, the number of views with and without security barrier setting, and the names of views with and without the security barrier setting.Sofware measureINFORMATION_SCHEMA+system catalog base tables2024-01-14 12:54MIT License
726Very similar column namesFind the pairs of table columns that name is different only by one symbol and that have the same type and/or domain.Problem detectionINFORMATION_SCHEMA+system catalog base tables2023-03-18 20:25MIT License
727Patterns of the names of columns of simple primary keysFind the patterns of the names of columns of simple primary keys. Make sure that the naming is consistent. Ideally, the names should indicate as to whether the column is a surrogate or a natural key column. PostgreSQL 14 added primary keys, unique constraints, and foreign keys to system catalogs. Thus the query was modified to exclude the results from the system catalog.Generalsystem catalog base tables only2023-01-20 13:40MIT License
728Patterns of the names of triggers and rulesFind the patterns of the names of trigger and rule names. Make sure that the naming is consistent.GeneralINFORMATION_SCHEMA+system catalog base tables2023-01-14 20:51MIT License
729All database privilegesFind the privileges to use the database. c - CONNECT; C - CREATE; T - TEMPORARY.Generalsystem catalog base tables only2021-11-23 20:28MIT License
730Perhaps a routine does not have a real taskFind the routines where the only action is to return an argument value, a constant value, NULL or return the value of OLD or NEW variable in case of trigger functions.Problem detectionINFORMATION_SCHEMA+system catalog base tables2021-11-05 12:09MIT License
731The size of base tables and their indexesFind the size of base tables without indexes, size of the indexes of the table, total size of the table (including its indexes) and percentage of the index size from the total size. If the size of indexes of a table is relatively high, then check as to whether all the indexes are needed.Generalsystem catalog base tables only2023-10-27 20:38MIT License
732The generic names (columns) (aggregate view)Find the too generic column names and the number of their occurrences.Problem detectionINFORMATION_SCHEMA+system catalog base tables2023-01-15 10:34MIT License
733The longest names of database objectsFind the TOP 3 longest (identifiers) names of user-defined objects.GeneralINFORMATION_SCHEMA+system catalog base tables2023-03-18 17:22MIT License
734The number of columns based on table typeFind the total number of columns in the different types of tables as well as average number of columns in the tables as well as minimal and maximal number of columns.Sofware measureINFORMATION_SCHEMA+system catalog base tables2022-11-10 14:12MIT License
735The number of default valuesFind the total number of columns with a default value as well as the number of columns with different kinds of default values (the number of columns where the default is used to implement surrogate key, the number of columns where the default is not used to implement surrogate key, the number of columns with a static default value, the number of columns with a dynamic default value).Sofware measureINFORMATION_SCHEMA only2021-11-22 13:26MIT License
736Incorrect check of NULLsFind the use of =NULL and <>NULL in case of table level check constraints, domain level check constraints, WHEN clauses of triggers, WHERE clauses of rules, subqueries of derived tables, and bodies of routines. Write correct code. In order to determine as to whether a value is missing or not one has to use the IS [NOT] NULL predicate. NULL is the marker in SQL that denotes a missing value. Although it is often called "NULL value", one cannot treat it as an ordinary value, i.e., use it in comparisons as a value.Problem detectionINFORMATION_SCHEMA+system catalog base tables2023-11-12 12:10MIT License
737Incorrect 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
738The same trigger function is used in case of multiple tablesFind trigger functions that are used in case of more than one table. Although it is legal, one must be careful when changing the functions in order to avoid unwanted consequences.GeneralINFORMATION_SCHEMA only2020-12-25 14:50MIT License
739Trigger 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
740Triggers with the same name in different schemasFind trigger names that are used in a database in more than one schema. Different things should have different names. But here different triggers have the same name. Also make sure that this is not a duplication.GeneralINFORMATION_SCHEMA+system catalog base tables2020-11-06 14:51MIT License