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...
501Reasonable upper bound to the length of textual values is missingFind non-foreign key base table columns that are not used to record comments/descriptions/explanations etc. and that have TEXT or VARCHAR type without restrictions to the field size (field size in case of VARCHAR or a CHECK constraint).Problem detectionINFORMATION_SCHEMA+system catalog base tables2021-12-16 12:32MIT License
502Non-foreign key base table columns with the same name have a different set of CHECK constraintsFind non-foreign key base table columns that have the same name but a different set of check constraints. The use of constraints should be consistent and all the necessary constraints must be enforced. "If you do something a certain way, do all similar things in the same way." (Robert C. Martin, Clean Code)Problem detectionINFORMATION_SCHEMA+system catalog base tables2021-10-31 20:39MIT License
503Base table columns permitting e-mail addresses without @ signFind non-foreign key base table columns that name refers to the possibility that these are used to register e-mail addresses. Find the columns that do not have any simple CHECK constraint that contains @ sign. A simple check constraint covers a single column. In this case registration of e-mail addresses without @ is most probably not prohibited.Problem detectionINFORMATION_SCHEMA+system catalog base tables2021-02-25 17:29MIT License
504Base table columns permitting telephone numbers without digitsFind non-foreign key base table columns that name refers to the possibility that these are used to register phone numbers. Find the columns that do not have any simple CHECK constraint that references to the character class of digits. A simple check constraint covers a single column. In this case registration of e-mail addresses without digits is most probably not prohibited.Problem detectionINFORMATION_SCHEMA+system catalog base tables2023-11-09 12:52MIT License
505Base table columns permitting negative prices/quantityFind non-foreign key base table columns that name refers to the possibility that these are used to register prices/quantities. Find the columns that do not have any simple CHECK constraints, i.e., a constraint that covers only this column. In this case registration of negative price/quantity is most probably not prohibited.Problem detectionINFORMATION_SCHEMA+system catalog base tables2023-10-06 14:14MIT License
506Base table columns permitting URLs without a protocolFind non-foreign key base table columns that name refers to the possibility that these are used to register URLs. Find the columns that do not have any simple CHECK constraint that references to a protocol. A simple check constraint covers a single column. In this case registration of URLs without a protocol is most probably not prohibited.Problem detectionINFORMATION_SCHEMA+system catalog base tables2023-11-01 13:13MIT License
507Perhaps an unsuitable use of CHAR(n) type in base tablesFind non-foreign key base table columns with the type CHAR(n) where n>1 that are not meant for storing codes or hash values. CHAR(n) is suitable for storing values that have a fixed length (for instance, country code according to the ISO standard). In case of variable length strings the end of the stored string is padded with spaces. Thus, for instance, do not use CHAR(n) in case of columns for storing names, comments, descriptions, e-mail addresses etc. Hash values have a fixed length that depends on the used hash function.Problem detectionINFORMATION_SCHEMA+system catalog base tables2023-11-12 10:46MIT License
508Base table columns permitting empty strings and strings that consist of only whitespace charactersFind non-foreign key columns of base tables that have a textual type and do not have any simple CHECK constraint, i.e., a constraint that involves only one column. Such columns can contain the empty string and strings that consist of only whitespace.Problem detectionINFORMATION_SCHEMA+system catalog base tables2021-02-25 17:29MIT License
509Base table columns permitting empty strings and strings that consist of only whitespace characters (2)Find non-foreign key columns of base tables that have a textual type and do not have a simple CHECK constraint (i.e., a constraint that involves only one column) that seems to prohibit empty strings and strings that consist of only whitespace as well as a simple CHECK constraint that specifies permitted symbols.Problem detectionINFORMATION_SCHEMA+system catalog base tables2024-01-02 16:52MIT License
510Columns of base tables that hold truth values but do not have a default value (non-Boolean columns)Find non-foreign key columns of base tables that probably (based on the column name) contain values that represent truth values but do not have a default value. There are only two truth values - TRUE and FALSE - in case of two-valued logic. It could be possible to select one of these as the default value in case of the columns.Problem detectionINFORMATION_SCHEMA+system catalog base tables2021-03-20 14:08MIT License
511Columns of base tables that hold truth values but do not restrict the permitted values (non-Boolean columns)Find non-foreign key columns of base tables that probably (based on the column name) contain values that represent truth values but do not have a have a check constraint. The constraint should restrict the permitted values with values that represent truth values TRUE and FALSE.Problem detectionINFORMATION_SCHEMA+system catalog base tables2021-03-20 14:07MIT License
512Three-valued logic (non-Boolean columns)Find non-foreign key columns of base tables that probably (based on the column name) contain values that represent truth values but do not have NOT NULL constraint. Use two-valued logic (TRUE, FALSE) instead of three-valued logic (TRUE, FALSE, UNKNOWN). Because NULL in a Boolean column means unknown make all the columns mandatory.Problem detectionINFORMATION_SCHEMA+system catalog base tables2021-03-20 14:07MIT License
513Overlapping non-function based indexes that have the same leading column with the same operator classFind non-function based indexes (both unique and non-unique) that duplicate each other because their first column is identical and the operator class that is used in case of the first column is identical. Include unique indexes that support a constraint (primary key, unique, exclude), i.e., these indexes have been automatically created due to the constraint declaration.Problem detectionsystem catalog base tables only2023-11-26 15:59MIT License
514Overlapping non-function based indexes that have the same leading column but with different operator classFind non-function based indexes (both unique and non-unique) that have identical first column but the operator class that is used in case of the first column is different. Include unique indexes that support a constraint (primary key, unique, exclude), i.e., these indexes have been automatically created due to the constraint declaration.Generalsystem catalog base tables only2023-10-28 15:05MIT License
515Do not leave out the referential constraints (based on classifiers)Find non-key and non-foreign columns of base tables with a textual column and small field size in case of which there is a table with the name that is similar to the column name. Perhaps the table is a classifier table and the column should have a foreign key constraint referencing to the table.Problem detectionINFORMATION_SCHEMA+system catalog base tables2021-03-18 11:14MIT License
516Non-key and non-foreign key base table columns with the same name and type that have in some cases permit NULLs and in some cases notFind non-key and non-foreign key base table columns with the same name and type that in some cases permit NULLs and in some cases not. Be consistent. Make sure that this selection is consistent.Problem detectionINFORMATION_SCHEMA+system catalog base tables2021-02-25 17:29MIT License
517Pairs of non-key column name and type pairs that have in different base tables a different default valueFind non-key base table columns with the same name and type that have different default values. Be consistent. Columns with the same name and type shouldn't probably have different default values in case of different tables. "If you do something a certain way, do all similar things in the same way." (Robert C. Martin, Clean Code)Problem detectionINFORMATION_SCHEMA+system catalog base tables2021-03-05 21:01MIT License
518Pairs of non-key column name and type pairs that have in some base tables a default value and some cases notFind non-key base table columns with the same name and type that have in some cases a default value and some cases not. Be consistent. Columns with the same name and type should probably either always have a default value in case of different tables or never have a default value in case of different tables. "If you do something a certain way, do all similar things in the same way." (Robert C. Martin, Clean Code)Problem detectionINFORMATION_SCHEMA+system catalog base tables2021-03-05 21:01MIT License
519Lifecycle not initiatedFind non-primary key and non-unique base table foreign key columns that name refers to the possibility that these are used to register references to a state classifier. The column must belong to a foreign key and does not have a default value.Problem detectionINFORMATION_SCHEMA+system catalog base tables2023-11-26 15:40MIT License
520Perhaps excessive privileges to use viewsFind non-SELECT privileges to use views (for others than the owner of the view). Perhaps there should be only the privilege to make queries (SELECT statements based on the views) and data modification takes place by using routines. REFERENCES and TRIGGER privileges are definitely not needed.Problem detectionINFORMATION_SCHEMA+system catalog base tables2021-02-25 17:29MIT License