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...
181Simple natural primary keysFind primary keys that consist of one column and that values are not generated by the system.GeneralINFORMATION_SCHEMA+system catalog base tables2021-03-08 00:47MIT License
182Small tablesFind tables that have one column or zero columns.GeneralINFORMATION_SCHEMA+system catalog base tables2021-03-07 10:52MIT License
183Storing file content in the databaseFind columns that probably store content of files in the database.GeneralINFORMATION_SCHEMA only2021-03-27 17:02MIT License
184Surrogate key columnsFind surrogate keys. Surrogate key is a key that consist of one column, which has an integer type. The key has been declared by using PRIMARY KEY or UNIQUE constraint. The column is associated with a sequence generator (either external or internal, i.e., created by the system automatically because the column has been declared as an identity column). The column does not participate in any foreign key.GeneralINFORMATION_SCHEMA+system catalog base tables2021-03-07 20:59MIT License
185Table check constraints with regular expressionsFind all CHECK constraints (except NOT NULL) that are associated with a base table or a foreign table column and use a regular expression. It is useful to enforce as many constraints at database level as possible. In this way one improves data quality as well as gives extra information to the database users (including the DBMS engines, development environments, and applications).GeneralINFORMATION_SCHEMA only2022-12-13 12:47MIT License
186Table columns that are associated with a sequence generatorSurrogate key values must be generated by using the system (the sequence generator mechanism in case of PostgreSQL). If there is no usage of sequence generators, then there is a question as to whether there are no surrogate keys in the database at all (could be possible and OK) or (more probable) developers have forgotten to implement the generation of surrogate keys.GeneralINFORMATION_SCHEMA only2021-03-07 21:06MIT License
187Table 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
188Table has both state and status columnsFind tables that contain both a state and a status column.GeneralINFORMATION_SCHEMA+system catalog base tables2023-01-14 15:26MIT License
189Table has multiple columns for free-form descriptionsFind tables that contain multiple columns for free-form textual descriptions. Make sure that the names of columns are understandable and sufficiently different. Make sure that there are no duplicate columns.GeneralINFORMATION_SCHEMA+system catalog base tables2023-01-14 15:36MIT License
190Table inheritanceFind inheritance between base tables. Use table inheritance carefully because, for instance, certain constraints are not inherited and must be redefined on child tables.Generalsystem catalog base tables only2020-11-15 13:02MIT License
191Table inheritance (path view)Find in case of each base table that participates in a table inheritance hierarchy the path to the table from the top-level table. Use table inheritance carefully because, for instance, certain constraints are not inherited and must be redefined on child tables. Also make sure that the identifier of each child table in an inheritance hierarchy is a hyponym of the identifier of its parent table.Generalsystem catalog base tables only2022-11-13 16:13MIT License
192Table privilegesCheck as to whether there are no unnecessary privileges.GeneralINFORMATION_SCHEMA only2020-12-29 10:38MIT License
193Tables that have associated user triggersFind information about tables that are associated with triggers.Generalsystem catalog base tables only2020-11-06 14:51MIT License
194Tables with the same name in different schemasFind tables with the same name in different schemas. Make sure that this is not a duplication.GeneralINFORMATION_SCHEMA+system catalog base tables2021-11-10 15:40MIT License
195The longest names of database objectsFind the TOP 3 longest (identifiers) names of user-defined objects.GeneralINFORMATION_SCHEMA+system catalog base tables2023-03-18 17:22MIT License
196The same database object name is used repeatedly in case the same database object typeFind what database object names are used more than once in case the objects of the same type. If the names differ from each other only by digits or underscores, then consider these the same name. For instance, if there are base tables Person and Person2 (in the same schema or different schemas), then the query returns the name Person. Make sure that there is no duplication of implementation elements in the database.GeneralINFORMATION_SCHEMA+system catalog base tables2023-03-17 01:12MIT License
197The same trigger function is used in case of multiple tablesFind trigger functions that are used in case of more than one table. Although it is legal, one must be careful when changing the functions in order to avoid unwanted consequences.GeneralINFORMATION_SCHEMA only2020-12-25 14:50MIT License
198The shortest 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 shortest (identifiers) names of user-defined objects by their type. These could be the first candidates of renaming in order to give to database objects better names.GeneralINFORMATION_SCHEMA+system catalog base tables2023-03-18 16:54MIT License
199The size of base tables and their indexesFind the size of base tables without indexes, size of the indexes of the table, total size of the table (including its indexes) and percentage of the index size from the total size. If the size of indexes of a table is relatively high, then check as to whether all the indexes are needed.Generalsystem catalog base tables only2023-10-27 20:38MIT License
200The usage of data type formatting functionsFind expressions that use a data type formatting function - to_char, to_number, to_date, to_timestamp.GeneralINFORMATION_SCHEMA+system catalog base tables2020-11-06 14:51MIT License