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...
521Optional non-foreign key base table columns that participate in a UNIQUE constraint or indexFind optional base table columns that participate in a UNIQUE constraint or index but do not participate in a foreign key constraint. Each base table has one or more candidate keys. One of these is usually selected to be the primary key, other are called alternate keys. To enforce an alternate key one should define a UNIQUE constraint and determine that all the key columns are mandatory (NOT NULL) just like the primary key columns are mandatory. Make sure that the NOT NULL constraint is not missing on these columns.Problem detectionINFORMATION_SCHEMA+system catalog base tables2022-10-21 10:45MIT License
522OverloadingMake sure that there is genuine overloading instead of duplication or dead code. "In some programming languages, function overloading or method overloading is the ability to create multiple functions of the same name with different implementations." (Wikipedia) In PostgreSQL one can do it automagically by having multiple routines with the same name but different parameters in the same schema.GeneralINFORMATION_SCHEMA+system catalog base tables2021-12-20 11:40MIT License
523Overloading may cause runtime errorRoutines in the same schema that have the same name and that have parameters with different types or different number of parameters are not considered to be in conflict at the creation time. However, if defaults are provided in the definition of parameters, then these routines might be conflict during runtime.Problem detectionINFORMATION_SCHEMA+system catalog base tables2021-10-25 16:11MIT License
524Pairs 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
525Pairs 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
526Parameter name contains the routine nameFind parameters that have the same name as the routine. The names may have different uppercase/lowercase characters. Make sure that the naming style is consistent.Problem detectionINFORMATION_SCHEMA+system catalog base tables2023-01-06 18:03MIT License
527Parameter name is the same as the name of a used columnIf the name of a routine parameter and the name of a column of a table that is used in the routine are the same, then it makes it more difficult to understand the code.Problem detectionINFORMATION_SCHEMA+system catalog base tables2023-01-20 13:54MIT License
528Parameter name is the same as the name of a used column (ver 2)If the name of a routine parameter and the name of a column of a table that is used in the routine are the same, then it makes it more difficult to understand the code.Problem detectionINFORMATION_SCHEMA+system catalog base tables2023-01-20 13:54MIT License
529Parameter name is the same as the routine nameFind parameters that have the same name as the routine. The names may have different uppercase/lowercase characters. Make sure that the naming style is consistent.Problem detectionINFORMATION_SCHEMA+system catalog base tables2023-01-06 18:03MIT License
530Paramtetes with an array type, XML, JSON, or JSONB typeFind parameters of user-defined routines that type is an array type, xml, json, or jsonb type. Make sure that the parameter name matches the type (perhaps should be in plural).GeneralINFORMATION_SCHEMA+system catalog base tables2023-01-14 20:21MIT License
531Partial or case insensitive unique indexesFind partial or case insensitive unique indexes. These implement uniqueness constraints that are impossible to enforce with the help of SQL's regular UNIQUE constraint.GeneralINFORMATION_SCHEMA+system catalog base tables2020-11-06 14:51MIT License
532Password is uniqueFind columns that potentially contains passwords and that participate in a unique constraint or indexProblem detectionINFORMATION_SCHEMA+system catalog base tables2022-06-09 13:21MIT License
533Password should not be open textFind base table columns that name refers to the possibility that these are used to register passwords. Find the columns that have a CHECK constraint that seems to determine the minimal or maximal permitted length of the values in the column. Passwords in a database table must be hashed and salted. Checking the strength of the password by using a check constraint is in this case impossible and the check constraints that try to do it should be removed from the database.Problem detectionINFORMATION_SCHEMA+system catalog base tables2021-02-25 17:29MIT License
534Patterns of the Boolean expressions of simple CHECK constraintsFind patterns of the Boolean expressions of simple CHECK constraints (involve only one column). Do not solve the same task in different places differently. The same rule could be implemented with CHECK constraints that have different Boolean expressions. "If you do something a certain way, do all similar things in the same way." (Robert C. Martin, Clean Code)GeneralINFORMATION_SCHEMA+system catalog base tables2022-11-13 16:06MIT License
535Patterns of the names of PRIMARY KEY, UNIQUE, CHECK, EXCLUDE, and FOREIGN KEY constraints as well as user-defined non-unique indexes that are associated with exactly one columnFind patterns of the names of constraints and indexes. Make sure that the naming is consistent.GeneralINFORMATION_SCHEMA+system catalog base tables2023-01-14 20:52MIT License
536Patterns of the names of PRIMARY KEY, UNIQUE, CHECK, EXCLUDE, and FOREIGN KEY constraints as well as user-defined non-unique indexes that are associated with two or three columnsFind patterns of the names of constraints and indexes. Make sure that the naming is consistent.GeneralINFORMATION_SCHEMA+system catalog base tables2023-01-14 20:52MIT License
537Patterns of the names of triggers and rulesFind the patterns of the names of trigger and rule names. Make sure that the naming is consistent.GeneralINFORMATION_SCHEMA+system catalog base tables2023-01-14 20:51MIT License
538Perahaps Coalesce invocation is missing or Concat should be usedFind user-defined routines and derived tables (views/materialized views) that have a subquery that invokes || operator but does not use Coalesce function to ensure that the arguments are not NULL. In PostgreSQL expression value || NULL returns NULL. In order to get value as the result, one has to replace NULL with a value (empty string) by using, for instance, Coalesce function (an alternative is to use a CASE expression). Instead of || + Coalesce, one could use Concat, Concat_ws, or Format functions for the concatenation.Problem detectionINFORMATION_SCHEMA+system catalog base tables2021-12-08 11:51MIT License
539Perhaps 0 instead of oFind the names of database objects where 0 sign is perhaps used instead of o.Problem detectionINFORMATION_SCHEMA+system catalog base tables2023-03-17 10:13MIT License
540Perhaps 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