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...
901Insufficient number of user-defined viewsThere must be at least n (four in this case) user-defined views in the database.Problem detectionINFORMATION_SCHEMA only2021-02-25 17:30MIT License
902Insufficient number of user-defined domainsThere must be at least n (one in this case) user-defined domains in the database each of that must be used in case of at least two columns of base tables.Problem detectionINFORMATION_SCHEMA only2021-02-25 17:30MIT License
903Insufficient number of user-defined base tablesThere must be at least n (seven in this case) user-defined base tables in the database.Problem detectionINFORMATION_SCHEMA only2021-02-25 17:30MIT License
904Insufficient number of user-defined foreign tablesThere must be at least n (two in this case) user-defined foreign tables in the database.Problem detectionINFORMATION_SCHEMA only2021-02-25 17:30MIT License
905Insufficient number of user-defined triggers+rules (based on number of tasks)There must be user-defined triggers and/or rules for at least n (three in this case) tasks in the database.Problem detectionINFORMATION_SCHEMA+system catalog base tables2024-01-04 11:46MIT License
906Insufficient number of user-defined triggers+rulesThere must be user-defined triggers and/or rules for at least n (three in this case) tasks in the database. It also means that one should create at least three triggers and/or rules in the database.Problem detectionINFORMATION_SCHEMA+system catalog base tables2024-01-04 11:47MIT License
907Cycle in a hierarchyThere should not be cycles in hierarchies meaning that the parent must always be specified. In this case a parent must reference to a child or to itself, otherwise it cannot be registered.Problem detectionsystem catalog base tables only2021-02-25 17:30MIT License
908PL/pgSQL functions without the RETURN clauseThe return value of a function cannot be left undefined. If control reaches the end of the top-level block of the function without hitting a RETURN statement, a run-time error will occur. This restriction does not apply to functions with output parameters and functions returning void, however. In those cases a RETURN statement is automatically executed if the top-level block finishes. It also does not apply to trigger functions that only task is to raise an exception.Problem detectionINFORMATION_SCHEMA+system catalog base tables2023-10-29 11:13MIT License
909Duplicate CHECK constraints that are connected to a domainThe same domain should not have multiple CHECK constraints with exactly the same Boolean expression. Do remember that the same task can be solved in SQL usually in multiple different ways. Thus, the exact copies are not the only possible duplication.Problem detectionINFORMATION_SCHEMA only2021-02-25 17:30MIT License
910Duplicate CHECK constraints that are connected directly to a tableThe same table should not have multiple CHECK constraints with exactly the same Boolean expression. Do remember that the same task can be solved in SQL usually in multiple different ways. Thus, the exact copies are not the only possible duplication.Problem detectionINFORMATION_SCHEMA only2021-02-25 17:30MIT License
911Logical size of a schemaThe schema size is the sum of the sizes of all tables in the schema.Sofware measureINFORMATION_SCHEMA+system catalog base tables2022-10-21 16:18MIT License
912Disabled system triggers (i.e., disabled enforcement of constraints)These triggers should be enabled because otherwise some important functionality regarding constraints like enforcing referential integrity does not work.Problem detectionsystem catalog base tables only2021-03-12 15:06MIT License
913Logical size of a tableThe table size is the sum of the total size of the simple columns and the total size of the complex columns in the table. In case of SQL databases large base tables in terms of number of columns could be a side effect of the problems with cloned columns or multiple columns for the same attribute. A base table with a low normalization level, which is meant to hold data that corresponds to multiple entity types has typically also relatively large number of columns compared with other base tables. Thus, the normalization level of base tables with a large number of columns should be checked as well.Sofware measureINFORMATION_SCHEMA+system catalog base tables2022-10-21 16:17MIT License
914Pointlessly returned valueThe value that is returned by a function should depend on something. If you do not have anything meaningful to return (for instance, the function always returns true, false, NULL, or the same number), then write VOID instead of the return type.Problem detectionINFORMATION_SCHEMA+system catalog base tables2021-11-04 15:01MIT License
915Referential degree of tablesThis metric represents the number of foreign keys in a base table.Sofware measureINFORMATION_SCHEMA only2021-03-12 11:07MIT License
916Perhaps too many input parametersToo many parameters (in this case four or more) could be a sign of not separating concerns and having a routine that has more than one task.Problem detectionINFORMATION_SCHEMA+system catalog base tables2021-11-04 10:57MIT License
917FILLFACTOR is probably too smallToo small fillfactor wastes storage space.Problem detectionINFORMATION_SCHEMA+system catalog base tables2022-11-02 10:43MIT License
918Wrong comment - trigger function does not implement a database operationTrigger functions should not contain references to database operations. Perhaps the trigger implements ensuring some invariant of the operation but it does not implement the operation itself.Problem detectionINFORMATION_SCHEMA+system catalog base tables2021-02-25 17:30MIT License
919The 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
920The 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