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...
21Base table column of sums of money does not have a numeric type (based on column names)Find base table columns that name refers to the possibility that these are used to register prices/sums of money. Find columns that do not have a numeric type.Problem detectionINFORMATION_SCHEMA only2021-03-21 11:45MIT License
22Base table column of sums of money has too big or small scaleFind base table columns that name refers to the possibility that these are used to register data about prices/sums of money. Find the columns that have decimal type but have a too big (bigger than six) or a too small scale (zero). The selection of field size must be precise and should take into account the possible data in the column.Problem detectionINFORMATION_SCHEMA only2021-03-21 11:45MIT License
23Base 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
24Base table columns for recording geographic coordinates that do not have a suitable type (based on column names)Find base table columns that are according to the name meant for recording geographic coordinate but do not have a suitable type (numeric or point).Problem detectionINFORMATION_SCHEMA only2021-10-08 12:01MIT License
25Base 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
26Base 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
27Base 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
28Base 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
29Base 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
30Base table columns with the same name and type have different field sizesFind base table columns that have the same name and type but different field size.Problem detectionINFORMATION_SCHEMA only2021-03-28 16:59MIT License
31Base table columns with the same name have different typesFind base table columns that have the same name but different type. In general, base tables columns that have the same name should have the same type as well.Problem detectionINFORMATION_SCHEMA only2023-01-14 20:54MIT License
32Base table columns with the type VARCHAR(1)The choice of data types should reveal as much as possible about the nature of the data in the column. The type of these columns could be CHAR(1) and they should have a constraint that a value in the column cannot be an empty string.Problem detectionINFORMATION_SCHEMA only2021-02-25 17:29MIT License
33Base 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
34Base tables and foreign tables that have no CHECK constraintsWhat are the base tables and foreign tables without any associated (directly or through domains) check constraints? A NOT NULL constraint is a kind of CHECK constraint. However, this query does not take into account NOT NULL constraints.Problem detectionINFORMATION_SCHEMA only2021-02-25 17:29MIT License
35Base tables that have a unique constraint but not the primary keyA common style is to declare in each base table one of the candidate keys as the primary key. All the other candidate keys would be alternate keys that will be enforce with the help of UNIQUE + NOT NULL constraints.Problem detectionINFORMATION_SCHEMA only2021-02-25 17:30MIT License
36Base tables that have neither a unique constraint nor the primary keyFind base tables without any unique constraints and the primary key. In such tables there are no restrictions for recording duplicate rows. Each row represents a true proposition about the real world. It does not make the proposition truer if one presents it more than once. Moreover, duplicate rows increase data size. Without keys the DBMS lacks vital information about data in the database that it can internally use to choose better execution plans and in this way improve performance of database operations. The only legitimate reason of such a table is if it is an abstract table that is used to define common columns of subtables.Problem detectionINFORMATION_SCHEMA only2021-02-25 17:30MIT License
37Base 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
38Base 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
39Base 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
40Base tables with multiple Boolean columnsFind base tables that have more than one column with Boolean type.GeneralINFORMATION_SCHEMA only2021-02-19 17:41MIT License