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...
341Foreign key references a non-key (has optional columns)Find foreign key constraints that referenced column is optional.Problem detectionINFORMATION_SCHEMA+system catalog base tables2021-03-10 12:12MIT License
342Foreign key references to a unique index columns not a unique key columnsFind foreign key constraints that reference to the columns that are covered by a unique index not a unique key.Problem detectionsystem catalog base tables only2022-10-21 10:30MIT License
343Foreign 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
344Foreign keys with ON DELETE CASCADEFind referential constraints (foreign key constraints) that employ ON DELETE CASCADE compensatory action. ON DELETE CASCADE should only be used if it has been created based on a generalization or a composition in the conceptual data model or if the foreign key connects a table that corresponds to the main entity type with a table that corresponds to a non-main entity type.Generalsystem catalog base tables only2020-11-16 10:15MIT License
345Foreign keys with ON UPDATE CASCADEReferential constraints (foreign key constraints) that employ ON UPDATE CASCADE compensatory action. ON UPDATE CASCADE should only be used if the referenced key is a natural key (its values can be changed).Generalsystem catalog base tables only2020-11-15 15:39MIT License
346Foreign 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
347FOR UPDATE in derived tablesFind derived tables that subquery uses FOR UPDATE construct. Reading a data element shouldn't block other read operations of the same element. Thus, you shouldn't use exclusive locking command in a view.Problem detectionINFORMATION_SCHEMA+system catalog base tables2022-12-12 11:11MIT License
348FOR UPDATE is not allowed with aggregate functionsImplement explicit locking correctly. Instead of writing, for instance, SELECT Count(*) AS cnt FROM person WHERE person_id=1 FOR UPDATE; one has to write SELECT person_id FROM person WHERE person_id=1 FOR UPDATE;Problem detectionINFORMATION_SCHEMA+system catalog base tables2021-11-04 11:23MIT License
349FOR UPDATE is not needed if there is no FROM clause in the SELECT statementFind routines that use SELECT … FOR UPDATE without selecting rows from a specific table. For instance: SELECT 'text' AS v FOR UPDATE;Problem detectionINFORMATION_SCHEMA+system catalog base tables2021-11-05 14:10MIT License
350Frequency of column name lengths based on the table typeFind in case of base tables, materialized views, and views the number of columns based on the length of the column name.Sofware measureINFORMATION_SCHEMA+system catalog base tables2022-11-22 14:43MIT License
351Frequency of lengths of the names of database objects"Names in software are 90 percent of what make software readable. You need to take the time to choose them wisely and keep them relevant. Names are too important to treat carelessly. Names should not cause confusion." (Robert C. Martin, Clean Code) Names should be expressive. Find how many names (identifiers) of database objects there are with different lengths. The values could be used to compare different databases.Sofware measureINFORMATION_SCHEMA+system catalog base tables2023-03-17 01:10MIT License
352Frequency of name components of database objects"Names in software are 90 percent of what make software readable. You need to take the time to choose them wisely and keep them relevant. Names are too important to treat carelessly. Names should not cause confusion." (Robert C. Martin, Clean Code) Names should be expressive. Find, what are the most popular components of the names (identifiers) of user-defined database objects, assuming, that the separator of the components is "_".Sofware measureINFORMATION_SCHEMA+system catalog base tables2023-03-17 10:12MIT License
353Frequency of table name lengths based on the table typeFind in case of base tables, materialized views, and views the number of tables based on the length of the table name.Sofware measureINFORMATION_SCHEMA+system catalog base tables2022-11-23 01:09MIT License
354Frequent names of database objects"Names in software are 90 percent of what make software readable. You need to take the time to choose them wisely and keep them relevant. Names are too important to treat carelessly. Names should not cause confusion." (Robert C. Martin, Clean Code) Names should be expressive. Find the names (identifiers) of user-defined database objects that occur at least twice as frequently as a name occurs in average. Also make sure that there is no duplication in play.Sofware measureINFORMATION_SCHEMA+system catalog base tables2023-03-17 10:08MIT License
355Frequent names of database objects by object type"Names in software are 90 percent of what make software readable. You need to take the time to choose them wisely and keep them relevant. Names are too important to treat carelessly. Names should not cause confusion." (Robert C. Martin, Clean Code) Names should be expressive. Find the names (identifiers) of user-defined database objects that occur at least twice as frequently as a name occurs in average in case of the particular type of database objects. Also make sure that there is no duplication in play.Sofware measureINFORMATION_SCHEMA+system catalog base tables2023-03-18 16:57MIT License
356Full text search columns that have no gin or gist indexFind columns of base tabels and materialized views with the type tsvector that do not have a gin or a gist index. These are the preferred index types for text search.Problem detectionINFORMATION_SCHEMA+system catalog base tables2023-11-07 09:22MIT License
357Full text search columns with other type of index than gin or gist indexFind columns of base tabels and materialized views with the type tsvector that do not have a gin or a gist index but have another type of index (e.g., b-tree). Gin and Gist are the preferred index types for text search.Problem detectionINFORMATION_SCHEMA+system catalog base tables2023-11-07 09:22MIT License
358Function in a function-based index of a column is different from the function that is used in the subquery of a derived tableFind cases where the function of a function-based index of a column is different from the function that is used in the query in a derived table based on the column.Problem detectionINFORMATION_SCHEMA+system catalog base tables2021-02-25 17:29MIT License
359Function in a function-based index of a column is different of the function that is used in the query in a routine based on the columnCreate appropriate indexes to speed up queries. If you apply a function to a column in a query, then create a function-based index based on the function to the column.Problem detectionINFORMATION_SCHEMA+system catalog base tables2021-11-04 17:26MIT License
360Functions 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