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...
41At most one row is permitted in a table (based on enumeration types)Find base tables and foreign tables where based on the type of a column, a key constraint, and a NOT NULL constraint can be at most one row. Make sure that this is the real intent behind the constraint, not a mistake. Find tables where a column has an enumeration type with exactly one value, the column has NOT NULL constraint, and constitutes a key, i.e., has the PRIMARY KEY or UNIQUE constraint.GeneralINFORMATION_SCHEMA+system catalog base tables2022-11-03 15:18MIT License
42Base table columns for recording geographic coordinates (based on column names)Find base table columns that are according to the name meant for recording coordinates.GeneralINFORMATION_SCHEMA only2021-10-08 11:59MIT License
43Base table columns for storing username, password, and saltFind base table columns that name refers to the possibility that these are used to register usernames, passwords, and salt. Password should not be open text. It should be a hash value that has been hashed by using salt.GeneralINFORMATION_SCHEMA only2020-11-06 14:51MIT License
44Base table columns where TOASTing is possibleFind all base table columns in case of which the system can use TOAST technique.Generalsystem catalog base tables only2020-11-06 14:51MIT License
45Base table columns where TOAST-ing strategy has been changedFind base table columns in case of which the system can use TOAST technique (due to the data type of the column) and where the toasting strategy has been changed so that it is different than the default strategy determined by the type. Make sure that the new strategy is optimal.Generalsystem catalog base tables only2020-11-06 14:51MIT License
46Base table columns with a composite typeFind base table columns with a composite type. Think through as to whether a column with a composite type could be replaced with a separate table.Generalsystem catalog base tables only2020-11-06 14:51MIT License
47Base table columns with an array typeFind base table columns with an array type. Think through as to whether a column with an array type could be replaced with a separate table.GeneralINFORMATION_SCHEMA+system catalog base tables2020-11-06 14:51MIT License
48Base table columns with CHAR(n) or VARCHAR(n) typeFind base table columns with CHAR(n) or VARCHAR(n) type and make sure that n is not too big or too small. Also make sure that you do not use CHAR(n) in case of columns that have to keep variable length strings. "Values of type character are physically padded with spaces to the specified width n, and are stored and displayed that way" (https://www.postgresql.org/docs/current/datatype-character.html)GeneralINFORMATION_SCHEMA only2020-11-06 14:51MIT License
49Base table columns with CITEXT typeFind base table columns with CITEXT type and make sure that case insensitivity is really needed in case of this column.Generalsystem catalog base tables only2020-11-06 14:51MIT License
50Base table columns with DECIMAL (p, s) or NUMERIC (p, s) typeFind base table columns with DECIMAL (p, s) or NUMERIC (p, s) type and make sure that precision p and scale s are not too big or too small.GeneralINFORMATION_SCHEMA only2020-11-06 14:51MIT License
51Base table columns with one of the following types: BIGINT, INTEGER, TEXT, or VARCHAR without max character lengthEach column should have the most appropriate data type. Developers sometimes misuse BIGINT, INTEGER, TEXT or VARCHAR type in places where a type that permits smaller values would be more appropriate and semantically descriptive.GeneralINFORMATION_SCHEMA only2020-11-06 14:51MIT License
52Base table columns with SMALLINT or BOOLEAN typeEach column should have the most appropriate data type. Developers sometimes forget to use SMALLINT type even if it is logically the best choice. Developers also sometimes forget to use BOOLEAN type and instead invent something.GeneralINFORMATION_SCHEMA only2020-11-06 14:51MIT License
53Base table columns with UUID typeEach column should have the most appropriate data type. If one does not want to have in a table the surrogate key that values are generated by using a sequence generator, then one may use instead a column with Universally Unique Identifiers as the key column.GeneralINFORMATION_SCHEMA only2021-03-07 20:57MIT License
54Base table FILLFACTOR is not 100Find all base tables where FILLFACTOR is not 100, i.e., the default value.GeneralINFORMATION_SCHEMA+system catalog base tables2020-11-06 14:51MIT License
55Base table has a national identification number as a keyFind base table columns that name refers to the possibility that these are used to register national identification numbers (personal codes). Find the columns that constitute a key of a table. This in turn enforces a (restrictive) business rule that all persons of interest come from one country. Make sure that the enforced constraint is valid, i.e., there is indeed such rule in the domain.GeneralINFORMATION_SCHEMA+system catalog base tables2020-11-06 14:51MIT License
56Base tables created based on a typeFind base tables that have been created based on a composite type and thnk through as to whether it was really needed.Generalsystem catalog base tables only2020-11-06 14:51MIT License
57Base tables that do not have a TOAST tableFind base tables that (due to the types of their columns) do not have an associated TOAST table for storing out-of-line data.Generalsystem catalog base tables only2020-11-06 14:51MIT License
58Base 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
59Base 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
60Base tables with multiple Boolean columnsFind base tables that have more than one column with Boolean type.GeneralINFORMATION_SCHEMA only2021-02-19 17:41MIT License