Filter Queries

Found 997 queries.

  • All the queries about database objects contain a subcondition to exclude from the result information about the system catalog.
  • Although the statements use SQL constructs (common table expressions; NOT in subqueries) that could cause performance problems in case of large datasets it shouldn't be a problem in case of relatively small amount of data, which is in the system catalog of a database.
  • Statistics about the catalog content and project home in GitHub that has additional information.

# Name Goal Type Data source Last update License
601 Only one value permitted in a non-inherited base table or a foreign table column (based on check constraints) Find columns of base tables or foreign tables in case of which a check constraint on the column permits only one value in the column. Exclude columns that are inherited from a supertable because the constraint may be correct if it is applied to a column of a subtable that is inherited from the supertable. Problem detection INFORMATION_SCHEMA+system catalog base tables 2024-04-30 20:16 MIT License View
602 ON UPDATE CASCADE is perhaps missing (based on the compensating actions of other foreign key constraints) Find inconsistencies of using ON UPDATE CASCADE in case of foreign key constraints. An example of inconsistency is that there are two foreign key constraints in different tables that refer to the same table and its candidate key. One of the constraints has ON UPDATE CASCADE compensating action one does not. ON UPDATE CASCADE usage should be consistent, otherwise it does not allow us to change key values in the primary table. More generally, there is a set of foreign key constraints F that refer to a candidate key of table T. It cannot be the case that a proper non-empty subset of these foreign keys have ON UPDATE CASCADE compensatory action. Either all the constraints in F should have it or none of it should have it (depending on circumstances). Problem detection system catalog base tables only 2022-04-30 18:39 MIT License View
603 ON UPDATE CASCADE is probably missing (based on column names) Find foreign key constraints that do not feature ON UPDATE CASCADE compensating action although people have a reason to change the key value in the primary table by assuming that the names of foreign key columns correctly point towards the use of natural keys in the table. Problem detection system catalog base tables only 2023-11-16 11:59 MIT License View
604 ON UPDATE CASCADE is probably missing (based on data types) Find foreign key constraints where the foreign key column does not have an integer type or uuid type and the foreign key constraint does not have ON UPDATE CASCADE compensating action. In this case the foreign key probably refferes to a natural key (i.e., a key that values have meaning outside the computer system) and ON UPDATE CASCADE would be suitable because the key values could be changed over time. Problem detection INFORMATION_SCHEMA+system catalog base tables 2023-10-06 14:19 MIT License View
605 ON UPDATE CASCADE is probably missing (based on the properties of the referenced column) Find the foreign key constraints that do not have ON UPDATE CASCADE and that referenced key is a simple key that has an integer type, is not covered by another foreign key, and does not have an associated sequence generator, i.e., the foreign key references a simple natural key. Problem detection INFORMATION_SCHEMA+system catalog base tables 2022-04-30 18:39 MIT License View
606 Optional base table columns that have a default value that is not the empty string Find optiona base table columns that have a default value that is not the empty string. Such columns should be mandatory. Problem detection INFORMATION_SCHEMA only 2021-02-25 17:29 MIT License View
607 Optional base table columns that participate in a UNIQUE constraint or index Find optional base table columns that participate in a UNIQUE constraint or index. Each base table has one or more candidate keys. One of these is usually selected to be the primary key, other are called alternate keys. To enforce an alternate key one should define a UNIQUE constraint and determine that all the key columns are mandatory (NOT NULL) just like the primary key columns are mandatory. Make sure that the NOT NULL constraint is not missing on these columns. Problem detection INFORMATION_SCHEMA+system catalog base tables 2022-10-21 15:57 MIT License View
608 Optional columns before mandatory columns Find cases where optional columns are before a mandatory column. Place mandatory columns before optional columns to improve comprehensibility of the table. Problem detection INFORMATION_SCHEMA only 2021-02-25 17:29 MIT License View
609 Optional composite foreign keys that do not have MATCH FULL specified Find optional composite foreign keys that do not have MATCH FULL specified. Without MATCH FULL the system will permit partial foreign key values Problem detection system catalog base tables only 2021-02-25 17:29 MIT License View
610 Optional non-foreign key base table columns that participate in a UNIQUE constraint or index Find optional base table columns that participate in a UNIQUE constraint or index but do not participate in a foreign key constraint. Each base table has one or more candidate keys. One of these is usually selected to be the primary key, other are called alternate keys. To enforce an alternate key one should define a UNIQUE constraint and determine that all the key columns are mandatory (NOT NULL) just like the primary key columns are mandatory. Make sure that the NOT NULL constraint is not missing on these columns. Problem detection INFORMATION_SCHEMA+system catalog base tables 2022-10-21 10:45 MIT License View
611 Overlapping non-function based indexes that have the same leading column with the same operator class Find non-function based indexes (both unique and non-unique) that duplicate each other because their first column is identical and the operator class that is used in case of the first column is identical. Include unique indexes that support a constraint (primary key, unique, exclude), i.e., these indexes have been automatically created due to the constraint declaration. Problem detection system catalog base tables only 2023-11-26 15:59 MIT License View
612 Overloading may cause runtime error Routines in the same schema that have the same name and that have parameters with different types or different number of parameters are not considered to be in conflict at the creation time. However, if defaults are provided in the definition of parameters, then these routines might be conflict during runtime. Problem detection INFORMATION_SCHEMA+system catalog base tables 2021-10-25 16:11 MIT License View
613 Pairs of base tables that have at least two columns with the same names and data types What are the pairs of base tables that have at least two columns with the same names and data types. The tables might violate the principle of orthogonal design and hence might facilitate uncontrolled data redundancy over different tables. Problem detection INFORMATION_SCHEMA only 2022-11-09 13:13 MIT License View
614 Pairs of non-key column name and type pairs that have in different base tables a different default value Find non-key base table columns with the same name and type that have different default values. Be consistent. Columns with the same name and type shouldn't probably have different default values in case of different tables. "If you do something a certain way, do all similar things in the same way." (Robert C. Martin, Clean Code) Problem detection INFORMATION_SCHEMA+system catalog base tables 2025-05-03 14:06 MIT License View
615 Pairs of non-key column name and type pairs that have in some base tables a default value and some cases not Find non-key base table columns with the same name and type that have in some cases a default value and some cases not. Be consistent. Columns with the same name and type should probably either always have a default value in case of different tables or never have a default value in case of different tables. "If you do something a certain way, do all similar things in the same way." (Robert C. Martin, Clean Code) Problem detection INFORMATION_SCHEMA+system catalog base tables 2021-03-05 21:01 MIT License View
616 Parameter name contains the routine name Find parameters that have the same name as the routine. The names may have different uppercase/lowercase characters. Make sure that the naming style is consistent. Problem detection INFORMATION_SCHEMA+system catalog base tables 2023-01-06 18:03 MIT License View
617 Parameter name is the same as the name of a used column If the name of a routine parameter and the name of a column of a table that is used in the routine are the same, then it makes it more difficult to understand the code. Problem detection INFORMATION_SCHEMA+system catalog base tables 2023-01-20 13:54 MIT License View
618 Parameter name is the same as the name of a used column (ver 2) If the name of a routine parameter and the name of a column of a table that is used in the routine are the same, then it makes it more difficult to understand the code. Problem detection INFORMATION_SCHEMA+system catalog base tables 2023-01-20 13:54 MIT License View
619 Parameter name is the same as the routine name Find parameters that have the same name as the routine. The names may have different uppercase/lowercase characters. Make sure that the naming style is consistent. Problem detection INFORMATION_SCHEMA+system catalog base tables 2023-01-06 18:03 MIT License View
620 Password is unique Find columns that potentially contains passwords and that participate in a unique constraint or index Problem detection INFORMATION_SCHEMA+system catalog base tables 2022-06-09 13:21 MIT License View