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...
381Too generic names regarding persons and their names (columns of derived tables)Find derived table columns that name refers to the possibility that these contain person names. The names of derived table columns that contain person names should refer to the role that the corresponding entity type has in the view. For instance, if view active_product has a column with the name surname, then the column name does not give information what is the role of the person in the context of the view. Better name would be, for instance, registrator_surname.Problem detectionINFORMATION_SCHEMA+system catalog base tables2022-11-10 14:25MIT License
382The number of columns based on table typeFind the total number of columns in the different types of tables as well as average number of columns in the tables as well as minimal and maximal number of columns.Sofware measureINFORMATION_SCHEMA+system catalog base tables2022-11-10 14:12MIT License
383Only ID primary keyFind base base tables have the simple primary key that contains a column with the (case insensitive) name id and an integer type. In addition, the primary key values are generated automatically by the system by using a sequence generator. In addition the base table must not have any unique constraint.Problem detectionINFORMATION_SCHEMA+system catalog base tables2022-11-09 15:15MIT License
384Pairs of base tables that have at least two columns with the same names and data typesWhat are the pairs of base tables that have at least two columns with the same names and data types. The tables might violate the principle of orthogonal design and hence might facilitate uncontrolled data redundancy over different tables.Problem detectionINFORMATION_SCHEMA only2022-11-09 13:13MIT License
385Empty schemasFind schemas without schema objects.Problem detectionINFORMATION_SCHEMA+system catalog base tables2022-11-04 15:30MIT License
386All user schemasFind all the schemas in the database that are not used for the system purposes.GeneralINFORMATION_SCHEMA only2022-11-04 15:14MIT License
387At most one row is permitted in a table (based on check constraints)Find base tables and foreign tables where based on a check constraint, 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 check constraint permits only one possible value in a column, 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:21MIT License
388At 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
389Potentially missing PRIMARY KEY or UNIQUE constraints (based on UUIDs)If something has to be unique, then it must be said to the system so that it could use the information for internal optimizations and enforce the constraint. Find columns that contain Universally Unique Identifiers but are not a part of any simple PRIMARY KEY/UNIQUE constraint and are also not part of a foreign key.Problem detectionINFORMATION_SCHEMA+system catalog base tables2022-11-03 11:18MIT License
390Multiple simple keys with integer valuesFind base tables that have more than one primary key or unique constraints that involve exactly one integer column. Do not overcomplicate the database. Perhaps some column in the table is redundant.Problem detectionINFORMATION_SCHEMA+system catalog base tables2022-11-03 11:15MIT License
391BOOLEAN 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
392Index 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
393FILLFACTOR is probably too smallToo small fillfactor wastes storage space.Problem detectionINFORMATION_SCHEMA+system catalog base tables2022-11-02 10:43MIT License
394All enumerated typesFind all enumerated types.GeneralINFORMATION_SCHEMA+system catalog base tables2022-10-31 10:19MIT License
395CHAR or VARCHAR columns have a default value that length is longer from the character maximum length of the columnFind table columns with CHAR or VARCHAR type that have a default value that length is longer from the character maximum length of the column. Choose a suitable data type, field size, and default value. If the value is longer, then it is impossible to register it in a field, i.e., it makes registration of data impossible (except if the excessive characters are spaces).Problem detectionINFORMATION_SCHEMA only2022-10-31 10:19MIT License
396Database can be accessed through PUBLIC privilegesFind as to whether the database access by users (applications) can take place thanks to PUBLIC privileges, i.e., find as to whether PUBLIC (all current and future users) has CONNECT privilege in the database. PUBLIC gets the privilege by default.Problem detectionsystem catalog base tables only2022-10-31 10:19MIT License
397All column DEFAULT valuesFind all the default values of base table, view, and foreign table columns.GeneralINFORMATION_SCHEMA only2022-10-31 10:18MIT License
398All clustered indexesFind all tables that rows have been physically sorted based on an index.Generalsystem catalog base tables only2022-10-31 10:17MIT License
399Perhaps a CHECK constraint about required personal name components is missingFind base tables that have optional columns for recording both given name and surname and do not have a CHECK constraint that requires that at least one of the name components must be registered in case of each person.Problem detectionINFORMATION_SCHEMA+system catalog base tables2022-10-31 01:16MIT License
400Base table column of personal names has questionable propertiesFind base table columns that name refers to the possibility that these are used to register personal names. Although there are very long personal names the general approach is to register a shortened version of these. Thus, a large field size is not a good idea because it would cause usability and security problems. There are persons who only have one name (mononymous persons). Database design must take it into account.Problem detectionINFORMATION_SCHEMA only2022-10-29 20:35MIT License