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...
361Deterministic (immutable) functions that do not have input parametersFind deterministic functions that do not have any input parameters. Make sure that it is correct because in general a deterministic function must calculate a value based on input.Problem detectionINFORMATION_SCHEMA+system catalog base tables2023-11-09 19:53MIT License
362Deterministic (immutable) functions that do not return a valueFind deterministic (immutable) functions that do not return a value. This goes against the idea of deterministic functions.Problem detectionINFORMATION_SCHEMA+system catalog base tables2023-12-20 19:33MIT License
363Different 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
364Different tasks of triggersFind different tasks that are solved by using triggers, i.e., different triggers on the same table or different tables that do the same thing are considered to solve one task.GeneralINFORMATION_SCHEMA+system catalog base tables2024-01-04 00:53MIT License
365Domain CHECK constraints with the same nameFind domain check constraint names that are used more than once (within the same schema or in different schemas). Different things should have different names. However, here different constraints have the same name. Also make sure that this is not a sign of duplication of domains.Problem detectionINFORMATION_SCHEMA only2021-02-25 17:30MIT License
366Too generic names (domain constraints)Find domain CHECK constraints that have a too generic name - for instance, the name contains word "data" ) or the name is an abbreviation of the constraint type name (for instance, "chk" or "chk1").Problem detectionINFORMATION_SCHEMA only2021-10-31 17:39MIT License
367Unused domains (for base table columns and parameters)Find domains that are not used in case of any base table column and routine (input or otput) parameter (as their type). Do not keep in your database elements that are not needed by anybody. These should be put in use or dropped, otherwise these are dead code.Problem detectionsystem catalog base tables only2021-02-25 17:30MIT License
368Domain declares the same default value for multiple independent foreign keysFind domains that declare a default value and that are used in case of multiple foreign key constraints that point to different tables. Domains should be used in a manner that does not cause unnecessary coupling of concerns. For instance, let us assume that columns client_state_type_code of table Client (that is used to implement the relationship with table Client_state_type) and worker_state_type_code of table Worker (that is used to implement the relationship with table Worker_state_type) have been defined based on the same domain. It the domain has a default value, then it determines the initial state of both clients and workers. However, it must be possible to determine the initial state independently in case of clients and workers.Problem detectionINFORMATION_SCHEMA+system catalog base tables2021-02-25 17:29MIT License
369Domain based on another domainFind domains that have been defined based on another domain. Do not specify domains based on existing domains. This would unnecessarily increase dependencies and complexity.Problem detectionINFORMATION_SCHEMA+system catalog base tables2021-02-25 17:29MIT License
370Default should be declared at the level of domain not at the level of base table columnsFind domains that have been used to define one or more base table non-foreign key columns and all the columns have the same default value that is associated directly with the column not with the domain. Write as little code as possible. If possible, move things "before the brackets" so to say. In this case it means declaring the default value at the level of the domain and not at the level of base table columns. An exception is when the domain is used to define foreign key columns. In this case, it would be appropriate to define the default value at the column level (because different foreign keys could have different default values).Problem detectionINFORMATION_SCHEMA+system catalog base tables2021-02-25 17:30MIT License
371Duplicate domainsFind domains that have the same properties (base type, character length, not null + check constraints, default value). There should not be multiple domains that have the same properties. Do remember that the same task can be solved in SQL usually in multiple different ways. Therefore, the domains may have syntactically different check constraints that solve the same task. Thus, the exact copies are not the only possible duplication.Problem detectionINFORMATION_SCHEMA+system catalog base tables2021-02-25 17:30MIT License
372All domain default valuesFind domains that specify a default values and columns that are defined based on the domain. Make sure that there are no unsuitable default values.GeneralINFORMATION_SCHEMA only2021-01-19 13:04MIT License
373NOT NULL domainsFind domains with NOT NULL constraints and base table columns that have been defined based on the domain. PostgreSQL CREATE DOMAIN statement documentation points out that it is possible to add NULL's to columns that have a NOT NULL domain and thus suggests to associate NOT NULL constraints with a column instead of the domain. However, this is a non-standard behavior and defeats the idea of domain as a reusable asset. The scenarios where NULLs can appear in columns with a NOT NULL domain are quite exotic and probably cannot appear in production environments.GeneralINFORMATION_SCHEMA+system catalog base tables2023-10-20 19:10MIT License
374Duplication of parent table CHECK constraints on the foreign key columnsFind duplicate constraints, which make it more difficult to maintain the constraints. 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+system catalog base tables2021-02-25 17:29MIT License
375Duplicate foreign key constraintsFind duplicate foreign key constraints, which involve the same columns and refer to the same set of columns.Problem detectionsystem catalog base tables only2021-02-25 17:30MIT License
376Duplication of simple CHECK constraints on the same columnFind duplication of simple CHECK constraints on the same base table or foreign table column. Duplication of the same constraint means that if one starts to manage the code, then changes have to be made in multiple places. The problem is essentially similar with the data redundancy problem that database normalization tries to reduce. 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+system catalog base tables2021-02-25 17:30MIT License
377Unused enumerated types (for base table columns, domains, and parameters)Find enumerated types that are not used in case of any base table column, domain, and routine (input or otput) parameter (as their type). Do not keep in your database elements that are not needed by anybody. These should be put in use or dropped, otherwise these are dead code.Problem detectionINFORMATION_SCHEMA+system catalog base tables2021-02-25 17:30MIT License
378Duplicate enumerated typesFind enumerated types with exactly the same values. There should not be multiple types that have the same values.Problem detectionINFORMATION_SCHEMA+system catalog base tables2021-02-25 17:30MIT License
379All event triggersFind event triggers, which are not associated to a specific schema object.Generalsystem catalog base tables only2020-12-24 14:54MIT License
380Excessive privileges on databases, schemas, domains, types, languages, foreign data wrappers, and foreign serversFind excessive privileges on databases, schemas, domains, collations, sequences, foreign data wrappers, and foreign servers that are probably not needed by a typical application.Problem detectionsystem catalog base tables only2021-12-31 14:40MIT License