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...
801Chains of ON DELETE CASCADEFind all referential paths (chains of of parent-child tables that are associated through foreign key constraints) where all foreign key constraints have ON DELETE CASCADE compensating actions. Be careful with too long chains.Generalsystem catalog base tables only2022-10-29 20:04MIT License
802CHECK constraints with the cardinality bigger than oneFind multicolumn CHECK constraints. Such constraints must be associated directly with a base table, i.e., these cannot be associated with a domain. Enforce as much data integrity as possible at the database level and prefer declarative constraints to a trigger.Generalsystem catalog base tables only2023-12-25 12:38MIT License
803CHECK constraints with the cardinality bigger than one that involve the same set of columnsCHECK constraints with the cardinality bigger than one that involve the same set of columns. Make sure that there is no duplication.Generalsystem catalog base tables only2023-12-25 12:39MIT License
804Column names that make joining more difficult (foreign key column name contains the table name)Find foreign keys where the name of the foreign key column and the corresponding primary key/unique column is different but the difference comes from the fact that the foreign key column name starts or ends with the table name. Simplify writing queries that have to join data from multiple base tables. If the columns that participate in the join condition have the same name, then one can use the USING syntax.Problem detectionsystem catalog base tables only2023-11-12 10:26MIT License
805Column names that make joining tables more difficultFind foreign keys where the name of the foreign key column and the corresponding primary key/unique column is different. Exclude foreign key columns that refer to the key of the same table because within each named table column names must be different. Simplify writing queries that have to join data from multiple base tables. If the columns that participate in the join condition have the same name, then one can use the USING syntax.Problem detectionsystem catalog base tables only2023-11-08 13:56MIT License
806Column names that make joining tables more difficult (quite similar names)Find foreign keys where the name of the foreign key column and the corresponding primary key/unique column is different and the difference is between two and four characters. Exclude foreign key columns that refer to the key of the same table because within each named table column names must be different. Simplify writing queries that have to join data from multiple base tables. If the columns that participate in the join condition have the same name, then one can use the USING syntax.Problem detectionsystem catalog base tables only2023-11-08 13:56MIT License
807Column names that make joining tables more difficult (very similar names)Find foreign keys where the name of the foreign key column and the corresponding primary key/unique column is different and the difference is one character. Exclude foreign key columns that refer to the key of the same table because within each named table column names must be different. Simplify writing queries that have to join data from multiple base tables. If the columns that participate in the join condition have the same name, then one can use the USING syntax.Problem detectionsystem catalog base tables only2023-11-08 13:56MIT License
808Columns of derived tables that name has been given by the systemFind columns of derived tables (i.e., views and materialized views) where in the creation statement of the table the name of the column has not been specified, i.e., it is generated by the system.Problem detectionsystem catalog base tables only2023-12-21 12:15MIT License
809Columns of derived tables that name has been given by the system (2)Find columns of derived tables (i.e., views and materialized views) where in the creation statement of the table the name of the column has not been specified, i.e., it is generated by the system.Problem detectionsystem catalog base tables only2023-12-21 12:17MIT License
810Comments of columnsFind all comments of columns of tables.Generalsystem catalog base tables only2023-10-18 14:09MIT License
811Comments 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
812Comments 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
813Comments of schemas, sequences, types, domains, domain constraints, and event triggersFind all the comments that have been added with a COMMENT statement to schemas, sequences, types, domains, and event triggers.Generalsystem catalog base tables only2023-01-19 15:04MIT License
814Composite foreign keysFind foreign keys that consist of more than one column. Make sure that the order of columns in the composite foreign key corresponds to the order of columns in the composite candidate key in the referenced table.Generalsystem catalog base tables only2020-11-06 14:51MIT License
815Composite 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
816Composite 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
817Composite 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
818Constraints that are not redefined in a subtableFind primary key, unique, foreign key, and exclude constraints that have been defined in a supertable (parent table) but not in its subtable. Unfortunately, PostgreSQL table inheritance is implemented in a manner that some constraints (CHECK, NOT NULL) are inherited from the supertable but others are not. "All check constraints and not-null constraints on a parent table are automatically inherited by its children, unless explicitly specified otherwise with NO INHERIT clauses. Other types of constraints (unique, primary key, and foreign key constraints) are not inherited." (PostgreSQL documentation)Problem detectionsystem catalog base tables only2021-02-25 17:29MIT License
819Constraints that are redefined in a subtable.Find primary key, unique, foreign key, and exclude constraints that have been defined in a supertable (parent table) and have been redefined in its subtable.Generalsystem catalog base tables only2020-12-02 17:28MIT License
820Constraint-supporting UNIQUE indexes with the same leading columnFind indexes that support a uniqueness constraint and have the same leading column.Generalsystem catalog base tables only2023-11-26 16:01MIT License