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
341 Duplicate comments Find comments that have been registered with a COMMENT statement and that are associated with more than one object. It would probably mean that a comment is incorrect or missing. Problem detection INFORMATION_SCHEMA+system catalog base tables 2024-12-21 17:31 MIT License View
342 Completely overlapping foreign keys Find completely overlapping foreign keys, i.e., the same set of columns of a table is covered by more than one foreign key constraint. These constraints could refer to the same table/key or different tables/keys. Problem detection INFORMATION_SCHEMA+system catalog base tables 2021-02-25 17:30 MIT License View
343 Duplicate keys Find completely overlapping key (primary key and unique) constraints. This is a form of duplication. It leads to the creation of multiple indexes to the same set of columns. Problem detection system catalog base tables only 2021-10-16 10:27 MIT License View
344 Composite foreign keys with an incorrect order of columns (ver 2) Find composite foreign keys where the order of columns does not correspond to the order of columns in the referenced candidate key. Find composite foreign keys in case of which the foreign key and candidate key are not the same in terms of data types of the columns. For instance, the query returns information about a foreign key that columns have the types (SMALLINT, INTEGER) that refers to the candidate key that columns have the types (INTEGER, SMALLINT). In SQL keys are ordered sets of columns. Thus, in case of composite foreign key declarations one has to pay attention that the order of columns in the FOREIGN KEY clause matches the order of columns in the REFERENCES clause. Problem detection system catalog base tables only 2021-02-25 17:29 MIT License View
345 Composite foreign keys with an incorrect order of columns (ver 1) Find composite foreign keys where the order of columns does not correspond to the order of columns in the referenced candidate key. Find composite foreign keys in case of which the foreign key and candidate key consist of columns with the same name but the order of columns in the keys is different. For instance, the query returns information about a foreign key (personal_code, country_code) that refers to the candidate key (country_code, personal_code). In SQL keys are ordered sets of columns. Thus, in case of composite foreign key declarations one has to pay attention that the order of columns in the FOREIGN KEY clause matches the order of columns in the REFERENCES clause. Problem detection system catalog base tables only 2021-02-25 17:29 MIT License View
346 Composite foreign keys with a mix of mandatory and optional columns Find composite foreign keys with a mix of mandatory and optional columns. In case of a composite foreign keys all the columns should either optional or mandatory in order to avoid problems with NULLs. Problem detection system catalog base tables only 2021-02-25 17:29 MIT License View
347 Too wide composite indexes Find composite indexes that do not support any constraint but are on more than three columns. Problem detection system catalog base tables only 2021-11-06 02:40 MIT License View
348 User-defined composite types Find composite types that are created by a user, i.e., the type is not created automatically by the database management system based on a relation. General system catalog base tables only 2020-11-06 14:51 MIT License View
349 Duplicate independent (i.e., not created based on a table) composite types Find composite types with the same attributes (regardless of the order of attributes). Make sure that there is no duplication. Problem detection system catalog base tables only 2021-02-25 17:29 MIT License View
350 Names of constraints (directly connected to a base table) and non-unique indexes that do not contain the associated column name Find constraints that are perhaps badly named. Find names of constraints (directly connected to a base table) and non-unique indexes that do not contain the associated column name. Problem detection system catalog base tables only 2022-10-21 10:41 MIT License View
351 Names of constraints (directly connected to a base table) that do not contain the table name Find constraints that are perhaps badly named. Table names help us to ensure the uniqueness of the names within a schema and make the names more expressive and user-friendly. Problem detection system catalog base tables only 2023-01-10 18:03 MIT License View
352 Table constraints with the cardinality bigger than one Find constraints that involve more than one columns. Check as to whether the names follow a common style or not. General system catalog base tables only 2020-11-19 13:34 MIT License View
353 Perhaps unnecessary Trim Find constraints where the use of Trim function is possibly unnecessary. CHECK constraint column!~'^[[:space:]]*$' already ensures that the values in the column cannot be empty strings or strings that consist of only whitespace. Trim(Column)!~'^[[:space:]]*$' - in this case the use of Trim function is unnecessary. Problem detection INFORMATION_SCHEMA only 2024-12-25 15:27 MIT License View
354 Perhaps the name referes to multiple concepts Find database objects that name contains words "and" (English) or "ja" (Estonian). Problem detection INFORMATION_SCHEMA+system catalog base tables 2024-12-21 16:36 MIT License View
355 Stating the obvious Find database objects that name contains words "data" or "info". These are noise words because databases are meant for storing and manipulating data/information. Problem detection INFORMATION_SCHEMA+system catalog base tables 2025-05-03 14:01 MIT License View
356 Database objects of the same type and case insensitive name in the same container Find database objects with the same type and case insensitive name in the same container. It can only happen if some of the names are case insensitive and others are case sensitive. For instance, the same schema can contain the table "Client" and client Problem detection INFORMATION_SCHEMA+system catalog base tables 2024-12-21 17:13 MIT License View
357 Database object that belong to the public interface (virtual data layer) and that names contain the letters õäöüÕÄÖÜ Find database object that belong to the database public interface (virtual data layer - consists of routines and derived tables) and that names contain the letters õäöüÕÄÖÜ (Estonian letters with a diacritic). These letters belong to the Estonian alphabet but do not belong to the ASCII character set. Although permitted by the DBMS, such letters might make it more difficult to use the interface by other programs. Problem detection INFORMATION_SCHEMA+system catalog base tables 2021-02-25 17:30 MIT License View
358 Database object that do not belong to the public interface (virtual data layer) and that names contain the letters õäöüÕÄÖÜ Find database object that do not belong to the database public interface (virtual data layer - consists of routines and derived tables) and that names contain the letters õäöüÕÄÖÜ (Estonian letters with a diacritic). These letters belong to the Estonian alphabet but do not belong to the ASCII character set. Although permitted by the DBMS, such letters might make the naming style inconsistent with the naming style of elements that belong to the public interface. If applications access base tables directly, then the letters can cause the same problems as in case of derived tables, i.e., applications may have difficulties with such names. Problem detection INFORMATION_SCHEMA+system catalog base tables 2021-02-25 17:30 MIT License View
359 Declaratively partitioned tables without partitions Find declaratively partitioned tables that do not have any partitions. Declarative partitioning is implemented in PostgreSQL starting from PostgreSQL 10. Problem detection INFORMATION_SCHEMA+system catalog base tables 2021-02-25 17:30 MIT License View
360 Declaratively partitioned tables with one partition Find declaratively partitioned tables that have exactly one partition. Declarative partitioning is implemented in PostgreSQL starting from PostgreSQL 10. If there is only one partition, then it raises question as to why the additional complexity associated with partitioning is needed. Problem detection INFORMATION_SCHEMA+system catalog base tables 2020-11-06 14:51 MIT License View