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 columns that have no indexFind foreign key columns that do not have an index. Foreign key columns are often used for performing join operations. It is useful to index such columns.Problem detectionINFORMATION_SCHEMA+system catalog base tables2021-02-25 17:30MIT License
422Foreign key constraint references to the columns of a UNIQUE constraint not to the columns of the PRIMARY KEY constraintFind foreign key constraints that reference to a UNIQUE constraint columns not to the PRIMARY KEY constraint columns. This is legal in SQL. However, a tradition is to refer to the primary key columns. If most of the foreign keys refer to the primary key columns, then it raises a question as to whether this kind of design decision has a good reason in a particular case or whether it is an inconsistency.Problem detectionsystem catalog base tables only2021-02-25 17:30MIT License
423Foreign key constraint references to the columns of a UNIQUE constraint not to the columns of the PRIMARY KEY constraint while the referenced table has the primary keyFind foreign key constraints that reference to a UNIQUE constraint columns not to the PRIMARY KEY constraint columns while at the same time the referenced table does have the primary key. This is legal in SQL. However, a tradition is to refer to the primary key columns. If most of the foreign keys refer to the primary key columns, then it raises a question as to whether this kind of design decision has a good reason in a particular case or whether it is an inconsistency.Problem detectionsystem catalog base tables only2021-02-25 17:30MIT License
424Foreign 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
425Foreign 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
426Foreign 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
427Foreign 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
428FOR 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
429FOR 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
430FOR 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
431Full 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
432Full 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
433Function 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
434Function 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
435Functions 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
436Function 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
437Generated 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
438Generated 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
439Grantable column privilegesFind column privileges that the carrier of the privilege can in turn grant to others, i.e., the privileges have been given WITH GRANT OPTION. The number of privileges that can be passed on should be as small as possible.Problem detectionINFORMATION_SCHEMA+system catalog base tables2024-01-07 13:43MIT License
440Grantable privileges on the database and its schemas, domains, types, languages, sequences, foreign data wrappers, and foreign serversFind privileges on the database and its schemas, domains, types, languages, sequences, foreign data wrappers, and foreign servers that the carrier of the privilege can in turn grant to others, i.e., the privileges have been given WITH GRANT OPTION. The number of privileges that can be passed on should be as small as possible.Problem detectionsystem catalog base tables only2024-01-07 13:43MIT License