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...
421Foreign key refers to a table that has at least one subtable in the inheritance hierarchyFind foreign key constraints that refer to a base table that has at least one subtable in the inheritance hierarchy. Rows of the subtable do not belong to the supertable in terms of checking the referential integrity. Let us assume that there is a table T with a subtable Tsub. Let us also assume that table B has a foreign key that refers to the table T. If a row is inserted into Tsub, then this row cannot be referenced from B.Problem detectionsystem catalog base tables only2021-02-25 17:30MIT License
422SET NULL compensatory action is unsuitableFind foreign key constraints that use a SET NULL compensating action but a foreign key column is mandatory, i.e., does not permit NULLs. Compensatory actions cannot make changes that violate integrity constraints in a database. SET NULL cannot put NULL to a mandatory column (delete a foreign key value).Problem detectionINFORMATION_SCHEMA+system catalog base tables2021-02-25 17:30MIT License
423Inconsistency of using column data types/field sizes in case of columns that implement relationshipsFind foreign key constraints where the candidate key columns (belong to a PRIMARY KEY/UNIQUE constraint) and foreign key columns do not have the same data type and field size. Primary key/unique columns and foreign key columns should have the same data type and field size. If, for instance, the primary key column has type INTEGER and foreign key column has type SMALLINT, then one cannot use all the primary key values as foreign key values.Problem detectionINFORMATION_SCHEMA+system catalog base tables2021-03-10 12:13MIT License
424ON 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 detectionINFORMATION_SCHEMA+system catalog base tables2023-10-06 14:19MIT License
425ON DELETE CASCADE is not needed (based on classifier tables)Find foreign key constraints with ON DELETE CASCADE compensating action that refer to classifier (reference data) tables.Problem detectionINFORMATION_SCHEMA+system catalog base tables2023-12-08 14:52MIT License
426Composite 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
427Column 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
428Column 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
429Column 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
430Column 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
431SET DEFAULT compensatory action is unsuitableFind foreign keys with SET DEFAULT compensatory action where the foreign key column does not have a default value. Compensatory actions cannot make changes that violate integrity constraints in a database. SET DEFAULT means that there shoud be a default value at the foreign key column.Problem detectionINFORMATION_SCHEMA+system catalog base tables2021-02-25 17:30MIT License
432Unused foreign serversFind foreign servers that do not have any associated foreign tables.Problem detectionINFORMATION_SCHEMA only2021-02-25 17:30MIT License
433Foreign servers without user mappingsFind foreign servers that do not have any associated user mappings. "A user mapping typically encapsulates connection information that a foreign-data wrapper uses together with the information encapsulated by a foreign server to access an external data resource."Problem detectionINFORMATION_SCHEMA+system catalog base tables2021-02-25 17:29MIT License
434Updataple foreign tables that refer to another PostgreSQL tableFind foreign tables that have been defined based on postgresql_fwd foreign data wrapper and that are updatable. Make sure that updatability is in this case needed.GeneralINFORMATION_SCHEMA only2020-11-06 17:15MIT License
435Function Upper or Lower is used in an index on a non-textual columnFind function-based indexes that are based on function Upper or Lower but have been defined on a non-textual column. Such indexes support case insensitive search but in case of non-textual columns this does not have a meaning.Problem detectionsystem catalog base tables only2021-02-25 17:30MIT License
436Functions that have transactional controlFind functions that contain transactional control statements (BEGIN, START TRANSACTION, COMMIT, ROLLBACK, SAVEPOINT) in their body. PostgreSQL does not permit transaction control in functions.Problem detectionINFORMATION_SCHEMA+system catalog base tables2021-11-04 10:50MIT License
437Generated stored base table columns that expression does not refer to any columnFind generated stored base table columns that expression does not refer to any column of the table. It could be that there will be a constant value in every row in case of this column. The support of generated columns was added to PostgreSQL 12.Problem detectionINFORMATION_SCHEMA only2021-02-25 17:29MIT License
438Generated stored base table columns duplicates another column in the tableFind generated stored columns in PostgreSQL base tables that duplicate other columns in the table.Problem detectionINFORMATION_SCHEMA only2021-02-25 17:30MIT License
439Generated stored base table columnsFind generated stored columns in PostgreSQL base tables. The support of generated columns was added to PostgreSQL 12. These could be used to improve the performance of queries.GeneralINFORMATION_SCHEMA only2020-11-06 14:51MIT License
440Referential degree of tables (ver 2)Find how many base tables are referenced from a base table by using foreign keys.Sofware measuresystem catalog base tables only2021-03-12 11:06MIT License