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...
101Base tables that have only the surrogate key and do not have any other columnDo not create unnecessary tables. If a table has cardinality 1 (one column), then most probably the values in this column should not be system generated unique values.Problem detectionINFORMATION_SCHEMA only2021-03-08 00:41MIT License
102Base tables where all the columns are optionalFind base tables where all the columns are optional, i.e., permit NULLs. In such tables can be rows with no identity value and thus indistinguishable from other rows.Problem detectionINFORMATION_SCHEMA only2021-02-25 17:30MIT License
103Base tables where all the unique columns are optionalFind the base tables where all the unique columns are optional. In such tables there can be rows without values that identify these rows. In this case there can be rows in the table where the values that should identify the row are missing.Problem detectionINFORMATION_SCHEMA+system catalog base tables2022-10-21 01:47MIT License
104Base tables where certainly registration time is not recordedFind base tables that do not have any column with a timestamp type. In such tables certainly registration time is not recorded. Make sure as to whether recording registration time is necessary.GeneralINFORMATION_SCHEMA only2021-02-26 00:41MIT License
105Base tables where uniqueness is achieved by using only unique indexesFind base tables where uniqueness is achieved by using only unique indexes, i.e., there is at least one unique index but no uniqueness constraints (PRIMARY KEY, UNIQUE, EXCLUDE)Problem detectionINFORMATION_SCHEMA+system catalog base tables2022-10-21 01:54MIT License
106Base tables, which statistics is probably not up to dateFind base tables where statistics has not been collected at all or it has been lastly collected more than 40 days ago.Problem detectionINFORMATION_SCHEMA+system catalog base tables2021-02-25 17:30MIT License
107Base tables with exactly one keyFind all base tables that have exactly one PRIMARY KEY or UNIQUE constraint. Find and enforce all the keys. Are you sure there are not more keys in the table?Generalsystem catalog base tables only2021-10-16 10:39MIT License
108Base tables with multiple Boolean columnsFind base tables that have more than one column with Boolean type.GeneralINFORMATION_SCHEMA only2021-02-19 17:41MIT License
109Base tables with multiple comment columnsFind base tables with more than one comment columnsGeneralINFORMATION_SCHEMA only2021-04-02 12:21MIT License
110Base tables with multiple name columnsFind base tables with more than one name columns. Perhaps the normalization level of the table is low.GeneralINFORMATION_SCHEMA only2021-04-02 12:21MIT License
111Base tables with multiple temporal columnsFind base tables that have more than one column with a temporal type (date or timestamp).GeneralINFORMATION_SCHEMA only2021-02-19 17:37MIT License
112Base tables with plenty of dataFind base tables that have 1000 rows or more.Generalsystem catalog base tables only2022-10-21 11:25MIT License
113Base tables with the biggest number of rowsFind the base tables that belong to the top 5 in terms of the number of rows in the table. There should be test data in the tables.Generalsystem catalog base tables only2022-10-21 01:48MIT License
114BOOLEAN base table and foreign table columns with a CHECK constraint that involves olnly this columnFind base table and foreign table columns with the Boolean type that has a CHECK constraint that involves only this column. Avoid unnecessary CHECK constraints. The Boolean type contains only two values and there is nothing to check. By creating a check that determines that possible values in the column are TRUE and FALSE, one duplicates the attribute constraint (column has a type). This is a form of duplication.Problem detectionINFORMATION_SCHEMA+system catalog base tables2021-02-25 17:29MIT License
115BOOLEAN base table and foreign table columns with a PRIMARY KEY, UNIQUE, or FOREIGN KEY constraint that involves olnly this columnFind base table columns with the Boolean type that has a PRIMARY KEY, UNIQUE, or FOREIGN KEY constraint that involves only this column. Avoid unnecessary constraints. It is quite improbable that there must be such constraints. For instance, a table with PRIMARY KEY () or UNIQUE () constraint can have at most two rows.Problem detectionINFORMATION_SCHEMA+system catalog base tables2022-11-03 10:46MIT License
116Boolean column for genderFind base table columns that have Boolean type and based on the column name are meant for recording data about gender.Problem detectionINFORMATION_SCHEMA only2022-04-18 00:57MIT License
117Candidate key columns that have a static default valueFind base table columns that are covered by a primary key or a unique constraint and that probably have a static default value.Problem detectionINFORMATION_SCHEMA+system catalog base tables2023-11-12 11:32MIT License
118Candidate keys and foreign keys of tables that participate in an inheritance hierarchiesFind primary key, unique, foreign key, and exclude constraints that have been defined in tables that participate in an inheritance hierarchy. Do not forget to redefine the constraints that are defined on supertables also on their subtables.Generalsystem catalog base tables only2020-11-06 14:51MIT License
119Candidate keys where all columns have a static default valueFind base table primary key and unique constraints where all columns probably have a static default value. Candidate key columns (columns that belong to the primary key or to an unique constraints) shouldn't have static default values unless you are enforcing a rule that a table can have at most one row. The point of default values is that system assigns them automatically. There cannot be multiple rows with the same key value.Problem detectionINFORMATION_SCHEMA+system catalog base tables2023-11-12 11:33MIT License
120Cannot accommodate all the fractional seconds in case of table columnsThe precision of a timestamp type of a column must be able to accommodate all the fractional seconds of the default value of the column. Find table columns with the type timestamp without time zone(m) or timestamp with time zone(m) that have a default value LOCALTIMESTAMP(n) or CURRENT_TIMESTAMP(n) WHERE n>m.Problem detectionINFORMATION_SCHEMA only2021-02-25 17:30MIT License