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...
861Grantable 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
862Grantable rolesFind roles that a member can grant to others, i.e., the role has been granted with ADMIN 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:42MIT License
863Granted rolesFind membership relations between roles.Generalsystem catalog base tables only2024-01-07 13:30MIT License
864Gratuitous context in the names of foreign key columnsFind foreign key columns that name contains twice the name of the referenced (primary) table.Problem detectionsystem catalog base tables only2021-02-25 17:29MIT License
865Gratuitous context in the names of schema objectsFind schema objects that name starts with the schema name and then has at least one more symbol. "Shorter names are generally better than longer ones, so long as they are clear. Add no more context to a name than is necessary" (Robert C. Martin, Clean Code) Shema is a namespace. There cannot be in the same schema two schema objects that belong to the same name class and have the same name.Problem detectionsystem catalog base tables only2021-02-25 17:30MIT License
866Identical indexesFind indexes that are identical, i.e., have the same properties, including uniqueness. The query considers all types of indexes, including indexes that have been automatically created to support a constraint and function-based indexes.Problem detectionsystem catalog base tables only2021-02-25 17:30MIT License
867Inconsistency (code vs. id) of naming foreign key and referenced candidate key columnsNaming of foreign key and referenced candidate key columns should be consistent. It cannot be so that in one table a value is labeled "id" like some surrogate key value and in another it "turns" into human-usable "code" or vice versa. An example:

Person(person_id, name)
Primary Key (person_id)

E_mail_address(e_mail_address_id, person_code, address)
Primary Key (e_mail_address_id)
Foreign key (person_code) References Person (person_id)
Problem detectionsystem catalog base tables only2021-02-25 17:30MIT License
868Inconsistent chain of relationships in terms of using ON UPDATE CASCADEIn case of a chain of relationships between tables (where the primary key and the foreign key have the same columns) the use of ON UPDATE CASCADE should be consistent - either all the involved foreign keys have ON UPDATE CASCADE compensating action or none of these have it. For instance, in the next example there is inconsistency, because if one changes the person_code in table Person, then the modification does not succeed because it does not cascade to the table Product. It is unclear as to whether it should be possible to change the person_code or not.

Person (person_code, surname)
Primary key (person_code)

Worker(person_code)
Primary key (person_code)
Foreign key (person_code) References Person (person_code) ON UPDATE CASCADE

Product(product_code, registrator)
Primary key (product_code)
Foreign key (registrator) References Worker (person_code) ON UPDATE NO ACTION
Problem detectionsystem catalog base tables only2021-02-25 17:30MIT License
869Index FILLFACTOR has been changedFind all indexes where FILLFACTOR is not the default. The default is different in case of different index types is different. In case of B-tree indexes the default is 90.Generalsystem catalog base tables only2022-11-02 10:58MIT License
870Installed extensionsTry to use as much the possibilities of the DBMS as possible. On the other hand, do not install extensions that are not needed in order not to overcomplicate the database.Generalsystem catalog base tables only2020-11-06 14:51MIT License
871More than one index on a columnFind base table columns that belong to more than one index (including automatically created indexes that support constraints).Generalsystem catalog base tables only2021-11-10 14:44MIT License
872Multiple inheritanceFind instances of multiple inheriance of base tables. Make sure that multiple inheritance is indeed needed.Generalsystem catalog base tables only2020-11-15 12:20MIT License
873Multiple tables share the same state classifierFind cases where multiple tables share the same state classifier. For each main entity type one should create a separate state classifier table. Even if the classifier values are the same in case of two entity types for now these may become different in the future. Having a shared state classifier table usually means very simplistic state machines (states active and inactive) that could point to the gaps in analysis.Problem detectionsystem catalog base tables only2023-12-30 15:51MIT License
874Multiple triggers that update tsvector valuesFind base tables that have multiple triggers to update tsvector values.Problem detectionsystem catalog base tables only2023-11-07 10:14MIT License
875Names of columns that hold personal names but do not take into account cultural diversityFind columns of tables (base tables, views, materialized views, foreign tables) that have the name first_name or last_name. Such column names do not take into account that different cultures use different personal name components and the number of possible components is more than two. If in a culture, the surname is presented before the given name, then the column names causes confusion.Problem detectionsystem catalog base tables only2021-02-25 17:30MIT License
876Names 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
877Names 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
878Names of indexes that do not contain the table nameFind indexes that do not support a declarative constraint and that are perhaps badly named. Table names make the names more expressive and user-friendly.Problem detectionsystem catalog base tables only2023-01-10 18:13MIT License
879Not inherited CHECK constraintsFind CHECK constraints that have been defined in a supertable (parent table) but not in its subtables. An entity that belongs to a subtype should also belong to its supertype. If a subtype entity satisfies some constraint, then logically it must also satisfy the constraints of the supertype as well. If CHECK constraints are not inherited, then this is not guaranteed. If you implement subtyping not merely reuse implementation in the subtables, then the subtables must have at least the same CHECK constraints as the supertable. CHECK(false) on a supertable is an appropriate CHECK constraint if one wants to prevent registering data directly to the supertable, i.e., data can only be added to the subtables.Generalsystem catalog base tables only2020-12-27 17:42MIT License
880Not inherited CHECK constraints that are recreated in the immediate subtableFind base table CHECK constraints that have been defined as NOT INHERITED but the constraint with the same Boolean expression has been defined in the immediate subtable of the table.Problem detectionsystem catalog base tables only2021-02-25 17:29MIT License