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...
321Columns with JSON, JSONB, or XML typeFind columns with JSON, JSONB, or XML type. Each columns should have the most appropriate data type.GeneralINFORMATION_SCHEMA+system catalog base tables2020-11-19 17:01MIT License
322YELLING IN COMMENTS!Find comments of derived tables and routines that consist of only uppercase letters. Do not use only uppercase (capital) letters in order to write comments. It means yelling and also makes text less readable.Problem detectionINFORMATION_SCHEMA+system catalog base tables2024-04-25 15:13MIT License
323Comments of derived tablesFind comments of derived tables (views and materialized views) that are registered in the system catalog witht a COMMENT statement. Find also comments on their associated objects (columns, triggers, rules). Make sure that the comments give relevant, useful, and correct information.Generalsystem catalog base tables only2023-01-19 12:14MIT License
324Comments of non-derived tablesFind comments of non-derived tables (base tables, foreign tables, and partitioned tables) that are registered in the system catalog witht a COMMENT statement. Find also comments on their associated objects (columns, constraints, indexes, triggers, rules). Make sure that the comments give relevant, useful, and correct information.Generalsystem catalog base tables only2023-01-19 12:30MIT License
325Comments of routinesFind comments of user-defined routines (functions or procedures) that are registered in the system catalog witht a COMMENT statement. Make sure that the comments give relevant, useful, and correct information.GeneralINFORMATION_SCHEMA+system catalog base tables2020-11-06 14:51MIT License
326Duplicate commentsFind 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 detectionINFORMATION_SCHEMA+system catalog base tables2023-03-16 20:33MIT License
327Completely overlapping foreign keysFind 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 detectionINFORMATION_SCHEMA+system catalog base tables2021-02-25 17:30MIT License
328Duplicate keysFind 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 detectionsystem catalog base tables only2021-10-16 10:27MIT License
329Composite 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 detectionsystem catalog base tables only2021-02-25 17:29MIT License
330Composite 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 detectionsystem catalog base tables only2021-02-25 17:29MIT License
331Composite foreign keys with a mix of mandatory and optional columnsFind 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 detectionsystem catalog base tables only2021-02-25 17:29MIT License
332Too wide composite indexesFind composite indexes that do not support any constraint but are on more than three columns.Problem detectionsystem catalog base tables only2021-11-06 02:40MIT License
333User-defined composite typesFind 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.Generalsystem catalog base tables only2020-11-06 14:51MIT License
334Duplicate independent (i.e., not created based on a table) composite typesFind composite types with the same attributes (regardless of the order of attributes). Make sure that there is no duplication.Problem detectionsystem catalog base tables only2021-02-25 17:29MIT License
335Names of constraints (directly connected to a base table) and non-unique indexes that do not contain the associated column nameFind 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 detectionsystem catalog base tables only2022-10-21 10:41MIT License
336Names of constraints (directly connected to a base table) that do not contain the table nameFind 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 detectionsystem catalog base tables only2023-01-10 18:03MIT License
337Table constraints with the cardinality bigger than oneFind constraints that involve more than one columns. Check as to whether the names follow a common style or not.Generalsystem catalog base tables only2020-11-19 13:34MIT License
338Perhaps the name referes to multiple conceptsFind database objects that name contains words "and" (English) or "ja" (Estonian).Problem detectionINFORMATION_SCHEMA+system catalog base tables2023-03-16 20:42MIT License
339Stating the obviousFind database objects that name contains words "data" or "info". These are noise words because databases are meant for storing and manipulating data/information.Problem detectionINFORMATION_SCHEMA+system catalog base tables2023-03-17 10:37MIT License
340Database objects of the same type and case insensitive name in the same containerFind 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 clientProblem detectionINFORMATION_SCHEMA+system catalog base tables2023-03-17 10:13MIT License