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...
901Perhaps primary key columns could be renamedFind the names of simple primary key columns that name does not follow the pattern _id or _code but it is quite similar.Problem detectionsystem catalog base tables only2022-12-01 14:34MIT License
902Perhaps Trim is missingFind derived tables (views and materialized views) that apparently concatenate values (by using || operator or use Concat function or use Format function) by putting a space between these but do not use Trim function to get rid of the extra space at the beginning or the end of the string.Problem detectionsystem catalog base tables only2023-12-13 13:53MIT License
903Perhaps unnecessary privileges to use the databaseFind as to whether a database user (except postgres), who is not a superuser, has Create (C) or Temporary (T) privileges to use the database.Problem detectionsystem catalog base tables only2021-11-23 20:42MIT License
904Personal names are uniqueFind all primary key and unique constraints of base tables that involve at least one column with personal names. Personal names are not unique and these cannot be (usually) used to guarantee uniqueness. Either one has declared a superkey instead of candidate key (i.e., the key contains a column that is not needed for uniqueness) or the key columns have been found incorrectly.Problem detectionsystem catalog base tables only2021-02-25 17:29MIT License
905Privileges 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 are not for the owner and not for the systemic user postgres. Make sure that there is the right amount of privileges for each and every relevant user.Generalsystem catalog base tables only2021-03-07 20:57MIT License
906Privileges on the database and its schemas, domains, types, languages, sequences, foreign data wrappers, and foreign servers that have been granted to a superuserFind privileges on the database and its schemas, domains, types, languages, sequences, foreign data wrappers, and foreign servers that have been granted to a superuser. Superuser can do anything in the database and thus does not need the privileges. The result is a sign that perhaps the executed GRANT statements were incorrect (wrong username) or the grantee later got superuser status (that it shouldn't have).Problem detectionsystem catalog base tables only2022-10-21 15:53MIT License
907Publications with no tablesFind publications that do not contain any table.Problem detectionsystem catalog base tables only2021-02-25 17:30MIT License
908PUBLIC has TEMPORARY privilege in the databaseFind as to whether PUBLIC (all current and future users) has TEMPORARY privilege in the database. PUBLIC gets the privilege by default.Problem detectionsystem catalog base tables only2021-12-31 15:52MIT License
909Recursive relationships with the same source and targetFind incorrectly implemented adjacency lists.Problem detectionsystem catalog base tables only2021-02-25 17:30MIT License
910Recursive rules that directly modify their home tableDo not cause potentially infinite loops. Recursive rules would fire itself over and over again. Although the system is able to detect these after executing a data modification statement it is better to avoid creating these altogether.Problem detectionsystem catalog base tables only2022-10-21 15:59MIT License
911Redundant indexesFind indexes that may be redundant. In addition to identical indexes it also considers indexes that cover the same columns and have the same properties except 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:29MIT License
912Referential 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
913Rules with the same name in different schemasFind rule names that are used in a database in more than one schema. Different things should have different names. But here different rules have the same name. Also make sure that this is not a duplication.Generalsystem catalog base tables only2020-11-06 14:51MIT License
914Rules with the same name within the same schemaFind names of rules that are used within the same schema more than once. Give different triggers different names.Problem detectionsystem catalog base tables only2021-02-25 17:30MIT License
915Sequences that are not owned by a table columnFind sequence generators that are not owned by a table column, i.e., if one drops the table or the column, then the sequence generator stays in place.Problem detectionsystem catalog base tables only2023-10-06 14:40MIT License
916Short cycle (columns)Find cases where two candidate keys of the same table that are also foreign keys reference to each other.Problem detectionsystem catalog base tables only2021-11-28 02:08MIT License
917Simple primary keys that column name does not contain the table nameFind simple primary keys that column name does not contain the table name. The naming should be clear and consistent.Problem detectionsystem catalog base tables only2023-03-19 10:35MIT License
918System-generated table constraint names (constraints that involve one column)Find the names of database constraints that have been system-generated. Additional restrictions are that the constraints must involve only one column and are associated directly with a table (not through a domain). Names should follow the same style. If there is a mix of system-generated and user-defined names, then the style is most probably different.Problem detectionsystem catalog base tables only2021-12-10 12:47MIT License
919Table constraints with the cardinality bigger than oneFind constraints that involve more than one columns. Check as to whether the names follow a common style or not.Generalsystem catalog base tables only2020-11-19 13:34MIT License
920Table constraints with the same name (constraints connected directly with a base table or a foreign table)Find base table and foreign table constraint names that are used in a database more than once (possibly in different schemas or in case of different types of constraints). Different things should have different names. But here different constraints have the same name. Also make sure that this is not a sign of duplication.Problem detectionsystem catalog base tables only2022-11-15 16:43MIT License