Seq nr | Name | Goal | Type | Data source | Last update▼ | License | ... |
---|---|---|---|---|---|---|---|
661 | Default is NULL | Find all tables where default value is NULL. NULL is the marker that denotes missing value. Implicitly all columns that do not have a default value have the default NULL. There is no need to specify such default value. | Problem detection | INFORMATION_SCHEMA only | 2021-02-25 17:30 | MIT License | |
662 | Default should be declared at the level of domain not at the level of base table columns | Find 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 detection | INFORMATION_SCHEMA+system catalog base tables | 2021-02-25 17:30 | MIT License | |
663 | Disabled user triggers | Identify disabled triggers. These should be enabled or dropped, otherwise these are dead code. | Problem detection | system catalog base tables only | 2021-02-25 17:30 | MIT License | |
664 | Domain CHECK constraints with the same name | Find 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 detection | INFORMATION_SCHEMA only | 2021-02-25 17:30 | MIT License | |
665 | Domain name and type name are the same | Use different names to avoid confusion. | Problem detection | INFORMATION_SCHEMA+system catalog base tables | 2021-02-25 17:30 | MIT License | |
666 | Domains with the same name in different schemas | Domains 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. | Problem detection | INFORMATION_SCHEMA only | 2021-02-25 17:30 | MIT License | |
667 | Duplicate CHECK constraints that are connected directly to a table | The 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 detection | INFORMATION_SCHEMA only | 2021-02-25 17:30 | MIT License | |
668 | Duplicate CHECK constraints that are connected to a domain | The 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 detection | INFORMATION_SCHEMA only | 2021-02-25 17:30 | MIT License | |
669 | Duplicate DEFAULT values of base table columns | Find base table columns that have both default value determined through a domain and default value that is directly attached to the column. Do not duplicate specifications of default values to avoid confusion and surprises. If column and domain both have a default value, then in case of inserting data the default value that is associated directly with the column is used. | Problem detection | INFORMATION_SCHEMA only | 2021-02-25 17:30 | MIT License | |
670 | Duplicate domains | Find 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 detection | INFORMATION_SCHEMA+system catalog base tables | 2021-02-25 17:30 | MIT License | |
671 | Duplicate enumerated types | Find enumerated types with exactly the same values. There should not be multiple types that have the same values. | Problem detection | INFORMATION_SCHEMA+system catalog base tables | 2021-02-25 17:30 | MIT License | |
672 | Duplicate foreign key constraints | Find duplicate foreign key constraints, which involve the same columns and refer to the same set of columns. | Problem detection | system catalog base tables only | 2021-02-25 17:30 | MIT License | |
673 | Duplicate materialized views | Find materialized views with exactly the same subquery. There should not be multiple materialized views with the same subquery. 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 detection | system catalog base tables only | 2021-02-25 17:30 | MIT License | |
674 | Duplicate NOT NULL constraints | Find 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 detection | INFORMATION_SCHEMA+system catalog base tables | 2021-02-25 17:30 | MIT License | |
675 | Duplicate rules | Find multiple rules with the same definition (event, condition, action) on the same table. 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 detection | system catalog base tables only | 2021-02-25 17:30 | MIT License | |
676 | Duplicate stored generated base table columns | Find base tables that have more than one stored generated column with the same expression. The support of generated columns was added to PostgreSQL 12. 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 detection | INFORMATION_SCHEMA only | 2021-02-25 17:30 | MIT License | |
677 | Duplicate triggers | Find 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 detection | INFORMATION_SCHEMA+system catalog base tables | 2021-02-25 17:30 | MIT License | |
678 | Duplicate views | Find views with exactly the same subquery. There should not be multiple views with exactly the same subquery. 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 detection | INFORMATION_SCHEMA only | 2021-02-25 17:30 | MIT License | |
679 | Duplication of simple CHECK constraints on the same column | Find 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 detection | INFORMATION_SCHEMA+system catalog base tables | 2021-02-25 17:30 | MIT License | |
680 | Enumerated or range types with the same name in different schemas | Find 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 detection | INFORMATION_SCHEMA+system catalog base tables | 2021-02-25 17:30 | MIT License |