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...
161Number of underlying tables of derived tablesFind for each view or materialized view the number of tables based on which the derived table has been directly defined. These tables could be base tables or derived tables.Sofware measureINFORMATION_SCHEMA+system catalog base tables2023-11-11 09:30MIT License
162Useless type indication (2)Find columns and parameters where the type of the identifier is perhaps explicitly indicated in the name.Problem detectionINFORMATION_SCHEMA+system catalog base tables2023-11-10 14:55MIT License
163Useless type indicationFind columns and parameters where the type of the identifier is perhaps explicitly indicated in the name.Problem detectionINFORMATION_SCHEMA+system catalog base tables2023-11-10 14:47MIT License
164Inconsistent use of length and char_length functionsFind as to whether both functions length and char_length are used in the database.Problem detectionINFORMATION_SCHEMA+system catalog base tables2023-11-10 14:38MIT License
165Perhaps USING syntax could be used for joining in the subqueries of derived tablesFind derived tables that use newer join syntax where join conditions are written in the WHERE clause but do not use USING synatx.Problem detectionINFORMATION_SCHEMA+system catalog base tables2023-11-10 14:14MIT License
166Perhaps brackets are missing in a regular expression that uses OR logical operationFind regular expressions where choice between alternatives has no brackets. Thus, instead of '(a|b|c)' there is 'a|b|c'. An example: '^a|b|c$' -permits in the string symbol "|" but '^(a|b|c)$' does not permit in the string symbol "|".Problem detectionINFORMATION_SCHEMA+system catalog base tables2023-11-09 20:22MIT License
167Deterministic (immutable) functions that do not have input parametersFind deterministic functions that do not have any input parameters. Make sure that it is correct because in general a deterministic function must calculate a value based on input.Problem detectionINFORMATION_SCHEMA+system catalog base tables2023-11-09 19:53MIT License
168Columns of base tables that hold truth values that do not have a default value although they could have it (non-Boolean columns)Find columns of base tables that do not have type BOOLEAN but are used to record Boolean values. Based on column names these implement a state machine or record agreements. At the same time the columns do not have a default value. There are only two truth values - TRUE and FALSE - in case of two-valued logic. It should be possible to select one of these as the default value of the column.Problem detectionINFORMATION_SCHEMA+system catalog base tables2023-11-09 16:40MIT License
169Columns of base tables that hold truth values that do not have a default value although they could have it (Boolean columns)Find columns of base tables that have type BOOLEAN. Based on column names these implement a state machine or record agreements. At the same time the columns do not have a default value. There are only two truth values - TRUE and FALSE - in case of two-valued logic. It should be possible to select one of these as the default value of the column.Problem detectionINFORMATION_SCHEMA only2023-11-09 16:39MIT License
170Length and char_lenfgth functions are used within the same expressionFind expressions that refer to both length and char_length functions. Make sure that the expression is correct.Problem detectionINFORMATION_SCHEMA+system catalog base tables2023-11-09 13:44MIT License
171Perhaps a state machine is implemented with Boolean columnsFind implementations of state machines that uses a set of one or more Boolean columns. These columns could have the type Boolean or could probably (based on the column name and non-participation in a foreign key) contain values that represent truth values.Problem detectionINFORMATION_SCHEMA+system catalog base tables2023-11-09 13:22MIT License
172Columns of base tables that hold truth values but do not have a default value (Boolean columns)Find columns of base tables that have type BOOLEAN but do not have a default value. There are only two truth values - TRUE and FALSE - in case of two-valued logic. Often it should be possible to select one of these as the default value of a column that has BOOLEAN type.Problem detectionINFORMATION_SCHEMA only2023-11-09 13:14MIT License
173Address field size is incorrect (too short or too long)Find base table columns that are meant for recording different types of addresses where the filed size does not take into account the possible maximum length.Problem detectionINFORMATION_SCHEMA only2023-11-09 12:55MIT License
174Base 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
175Table functions with OFFSETFind table functions that use OFFSET. OFFSET method is a common way for implementing pagination.Problem detectionINFORMATION_SCHEMA+system catalog base tables2023-11-09 12:13MIT License
176Inconsistent referencing to character classesFind as to whether regular expressions use inconsistently references to character classes: [^\s], [^\d], [^\w], [^[:space:]], [^[:digit:]], [^[:word:]] vs [^\S], [^\D], [^\W].Problem detectionINFORMATION_SCHEMA+system catalog base tables2023-11-09 12:02MIT License
177Double negatives in regular expressionsFing regular expression patterns that use [^\S] instead of \s or [^\D] instead of \d or [^\W] instead of \w.Problem detectionINFORMATION_SCHEMA+system catalog base tables2023-11-09 12:01MIT License
178LIKE instead of =Find expressions that use LIKE predicate for precise comparison.Problem detectionINFORMATION_SCHEMA+system catalog base tables2023-11-09 10:43MIT License
179Perhaps incorrect check of permitted timestamp valuesFind base table columns with a timestamp type and a simple check constraint that checks as to whether the timestamp values are within an appropriate range of values. Find constraints where the check of the upper bound of the range is perhaps incorrect.Problem detectionINFORMATION_SCHEMA+system catalog base tables2023-11-09 10:27MIT License
180Temporal function in a simple check constraint is inconsistent with the column typeFind base table columns with a check constraint that refers to a temporal function (current_timestamp, localtimestamp, current_date, or now) that return type is inconsistent with the data type of the column.Problem detectionINFORMATION_SCHEMA+system catalog base tables2023-11-08 21:43MIT License