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...
821The number of SQL-language routines with different types of bodiesFind for each user schema that contain a SQL-language routine how many of these have the body that is string literal and how many have the body (possible starting from PostgreSQL 14) that is parsed at the routine definition time. Try to be consistent, i.e., use the same solution in case of all the routines.Sofware measureINFORMATION_SCHEMA+system catalog base tables2022-12-02 11:33MIT License
822The number of table constraints with the cardinality bigger than oneFind the number of table constraints with the cardinality bigger than one. Find the number, based on the cardinality, constraint type, and cardinality+constraint type.Sofware measuresystem catalog base tables only2020-11-19 13:29MIT License
823The number of tables based on the number of columnsFind how many tables with a certain range of the number of columns there are in the database.Sofware measureINFORMATION_SCHEMA+system catalog base tables2021-03-25 11:17MIT License
824The number of tables by schema, by type, and in totalFind the number of tables (base, foreign, and derived) in different schemas.Sofware measureINFORMATION_SCHEMA+system catalog base tables2021-03-07 10:57MIT License
825The 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
826The 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
827The 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
828The number of user-defined rulesFind the number of rules in a database, excluding the rules that are associated with system catalog tables and rules that are created to support views. Rules can be used to maintain data integrity in a database by causing rejection of incorrect insertions and updates. Therefore, the number of rules in a database gives some indications about the state of enforcing constraints at the database level.Sofware measuresystem catalog base tables only2022-10-21 11:19MIT License
829The number of user-defined rules by schema and in totalFind the number of rules in a database in different schemas, excluding the rules that are created to support views. Rules can be used to maintain data integrity in a database by causing rejection of incorrect insertions and updates. Therefore, the number of rules in a database gives an indication about the state of enforcing constraints at the database level.Sofware measuresystem catalog base tables only2022-10-21 11:29MIT License
830The number of user-defined triggersTriggers can be used to maintain data integrity in a database by causing rejection of data that does not conform to certain rules. Therefore, the number of triggers in a database gives some indications about the state of enforcing constraints at the database level. The query does not count internal triggers.Sofware measureINFORMATION_SCHEMA+system catalog base tables2020-11-06 14:51MIT License
831The 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
832The number of user-defined triggers by schema, by type, and in totalTriggers can be used to maintain data integrity in a database by causing rejection of data that does not conform to certain rules. Therefore, the number of triggers in a database gives an indication about the state of enforcing constraints at the database level.Sofware measureINFORMATION_SCHEMA+system catalog base tables2020-11-06 14:51MIT License
833The proportion of mandatory and optional textual base table columnsFind the number of textual base table columns, the number of optional textual base table columns (permit NULLs), and the number of mandatory textual base table columns (do not permit NULLs).Sofware measureINFORMATION_SCHEMA only2021-01-15 17:39MIT License
834The proportion of using different integer types as types of base table columnsFind the number of base table columns that use different integer types (SMALLINT, INTEGER, BIGINT) and their proportion from the overall set of columns that use an integer type.Sofware measureINFORMATION_SCHEMA only2021-03-03 12:41MIT License
835The reference to a database operation is missing from a commentFind user-defined routines that comment does not contain a reference to a database operation that the routine implements. In case of routines that have been created based on the contracts of database operations, one should refer to the short identifier of the operation in the comment of the routine. The operation identifier must be in this case in the form OP, but other forms could be used as well.Problem detectionINFORMATION_SCHEMA+system catalog base tables2021-11-04 11:39MIT License
836There is no reason to use PL/pgSQL if you do not use one or more features of a procedural languageUsing PL/pgSQL may cause context switching between declarative SQL and procedural PL/pgSQL. Thus use PL/pgSQL only if you truly need some of its constructs (variables, conditional statements, cycles, cursors, exception handling).Problem detectionINFORMATION_SCHEMA+system catalog base tables2021-11-04 16:32MIT License
837There is no reason to use PL/pgSQL to write table functionsUsing PL/pgSQL may cause context switching between declarative SQL and procedural PL/pgSQL. Thus use PL/pgSQL only if you truly need some of its constructs. You can create table functions by using SQL.Problem detectionINFORMATION_SCHEMA+system catalog base tables2021-11-04 11:28MIT License
838The same CHECK has a different name in different placesFind the names of table CHECK constraints that have the same Boolean expression but a different naming style in different places (tables). The naming of constraints should be consistent. "If you do something a certain way, do all similar things in the same way." (Robert C. Martin, Clean Code)Problem detectionsystem catalog base tables only2023-01-14 20:47MIT License
839The same database object name is used repeatedly in case the same database object typeFind what database object names are used more than once in case the objects of the same type. If the names differ from each other only by digits or underscores, then consider these the same name. For instance, if there are base tables Person and Person2 (in the same schema or different schemas), then the query returns the name Person. Make sure that there is no duplication of implementation elements in the database.GeneralINFORMATION_SCHEMA+system catalog base tables2023-03-17 01:12MIT License
840The same name is used in different contexstsFind the names that are used in case of different types of elementsProblem detectionINFORMATION_SCHEMA+system catalog base tables2023-03-17 10:33MIT License