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...
341Duplicate 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
342Duplicate 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
343Duplicate NOT NULL constraintsFind columns that have NOT NULL constraint through a domain and also directly. Do not duplicate NOT NULL constraints in orde to avoid confusion and surprises.Problem detectionINFORMATION_SCHEMA+system catalog base tables2021-02-25 17:30MIT License
344Duplicate removal of duplicates in derived tablesFind derived tables (views and materialized views) that contain both DISTINCT and GROUP BY. Make sure that the means for removing duplicate rows from the query result are not duplicated.Problem detectionINFORMATION_SCHEMA+system catalog base tables2021-02-25 17:29MIT License
345Duplicate specification of character classesFind regular expressions where within the same specification of a character class the character class alnum as well as 0-9, \d, A-Z, or a-z has been defined.Problem detectionINFORMATION_SCHEMA+system catalog base tables2023-12-24 10:43MIT License
346Duplicate triggersFind cases where the same table has multiple triggers with the same type (row-level, statement-level) that react to the same event with the same WHEN condition and with the same way (by invoking the same function).Problem detectionINFORMATION_SCHEMA+system catalog base tables2021-02-25 17:30MIT License
347Duplicate user-defined routinesFind user-defined routines with the exact duplicate body and parameters. There should not be multiple routines with exactly the same body and parameters (name, type). Having such duplicates is redundancy. Do remember that the same task can usually be solved in multiple different ways. Thus, the exact copies of routine bodies are not the only possible duplication. Moreover, it could be that different routines that solve the same task have different parameter names (but the parameters have the same types, ordinal positions, default values or the routines have different order of parameters). Thus, the query does not find all the duplications.Problem detectionINFORMATION_SCHEMA+system catalog base tables2021-11-05 11:59MIT License
348Duplication of case insensitivity specification in a regular expressionFind regular expressions that use both case insensitive search operator ~* and case insensitivity modifier (?i).Problem detectionINFORMATION_SCHEMA+system catalog base tables2021-11-04 12:49MIT License
349Duplication 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
350Duplication 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
351Each table is both referencing and referenced table (perhaps there is a cycle in relationships)Find as to whether the relationships between tables form a complete bidirected graph. Tables are vertices in the graph. There is a directed edge between two vertices if one of the tables refers to another through foreign key relationship on mandatory columns.Problem detectionINFORMATION_SCHEMA+system catalog base tables2021-11-28 14:04MIT License
352Empty columnsFind columns in non-empty tables that do not contain any values. If there are no values in a columns, then it may mean that one hasn't tested constraints that have been declared to the column or implemented by using triggers. It could also mean that such columns are not needed at all.Problem detectionINFORMATION_SCHEMA+system catalog base tables2021-02-25 17:29MIT License
353Empty schemasFind schemas without schema objects.Problem detectionINFORMATION_SCHEMA+system catalog base tables2022-11-04 15:30MIT License
354Enumerated or range types with the same name in different schemasFind cases where in different schemas there are enumerated or range types with the same name. Types are like words that can be used to construct generalized claims about the real world (table predicates). Better not to duplicate the words in the dictionary. Also make sure that this is not a duplication.Problem detectionINFORMATION_SCHEMA+system catalog base tables2021-02-25 17:30MIT License
355Enumerated types with zero or one valueFidn enumerated types with zero or one value. Type is a named finite set of values. The empty set is a set. A set with one value is a set. Thus, types with zero or one value are legal. In practical terms each type, usually, should contain at least two values.Problem detectionINFORMATION_SCHEMA+system catalog base tables2021-02-25 17:30MIT License
356Exclude constraint to prevent overlapping time periodsFind exclude constraints on base tables with multiple date/timestamp columns that prevent overlapping time periods.GeneralINFORMATION_SCHEMA+system catalog base tables2023-11-07 00:44MIT License
357Explicit lockingPostgreSQL uses Multi-version Concurrency Control (MVCC) and thus, sometimes, one has to explicitly lock certain rows or entire table. One has to use LOCK TABLE or SELECT … FOR UPDATE statements for that.GeneralINFORMATION_SCHEMA+system catalog base tables2023-12-11 15:02MIT License
358Explicit locking is missingPostgreSQL uses multiversion concurrency control (MVCC). SELECTs do not block modifications and vice versa. One has to take steps to achieve correct behaviour.Problem detectionINFORMATION_SCHEMA+system catalog base tables2024-01-14 00:35MIT License
359Explicit locking is missing (2)Find user-defined routines that have a subquery in a DELETE or UPDATE statement without the FOR UPDATE clause.Problem detectionINFORMATION_SCHEMA+system catalog base tables2023-12-06 12:15MIT License
360Explicit locking is probably not neededYou do not need explicit locking (LOCK TABLE or SELECT … FOR UPDATE) in case of routines that only search some data but do not modify any data and do not raise any exception.Problem detectionINFORMATION_SCHEMA+system catalog base tables2021-11-04 12:08MIT License