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...
441User-defined non-trigger SQL and PL/pgSQL routinesFind the non-trigger SQL and PL/pgSQL routines in non-systemic schemas.GeneralINFORMATION_SCHEMA+system catalog base tables2021-12-23 02:40MIT License
442ROW level BEFORE DELETE and INSTEAD OF DELETE triggers that procedures refer to the row variable NEWDo not write incorrect code. Variable NEW: "Data type RECORD; variable holding the new database row for INSERT/UPDATE operations in row-level triggers. This variable is null in statement-level triggers and for DELETE operations." (PostgreSQL documentation)Problem detectionINFORMATION_SCHEMA+system catalog base tables2021-12-20 14:25MIT License
443STATEMENT level triggers that refer to the values of row variables NEW or OLDFind STATEMENT level triggers that refer to the values of row variables NEW or OLD. NEW and OLD are special variables that can only be used in row-level trigger procedures.Problem detectionINFORMATION_SCHEMA+system catalog base tables2021-12-20 14:23MIT License
444ROW level BEFORE INSERT and INSTEAD OF INSERT triggers that procedures refer to the row variable OLDDo not write incorrect code. Variable OLD: "Data type RECORD; variable holding the old database row for UPDATE/DELETE operations in row-level triggers. This variable is null in statement-level triggers and for INSERT operations." (PostgreSQL documentation)Problem detectionINFORMATION_SCHEMA+system catalog base tables2021-12-20 14:22MIT License
445OverloadingMake 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
446Perhaps duplicate check of empty strings (ver 2)Find columns that have a check that prevents the empty string in the column but there is already another check on the column that enforces the constraint.Problem detectionINFORMATION_SCHEMA+system catalog base tables2021-12-20 11:30MIT License
447Permitting in a column only empty strings and strings that consist of whitespace charactersFind table CHECK constraints that permit in a column only empty strings or strings that consist of only whitespace characters.Problem detectionINFORMATION_SCHEMA only2021-12-19 15:10MIT License
448Duplicate check of empty stringsFind columns that have a check that prevents the empty string in the column but there is already another check on the column that enforces the constraint. If there is a constraint description!~'^[[:space:]]*$', then it covers the constraint description!='' and the latter becomes redundant.Problem detectionINFORMATION_SCHEMA+system catalog base tables2021-12-19 15:08MIT License
449Reasonable 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
450PL/pgSQL functions with consecutive RETURN clausesFind PL/pgSQL functions with consecutive RETURN clauses. Only the first RETURN will be used, others are unnecessary.Problem detectionINFORMATION_SCHEMA+system catalog base tables2021-12-16 11:38MIT License
451All exclude constraintsFind all exclude constraints.Generalsystem catalog base tables only2021-12-16 11:21MIT License
452Consistency of CHECK constraint name and contentFind all CHECK constraints that name contains a digit. Make sure that the name and the Boolean expression are consistent.GeneralINFORMATION_SCHEMA only2021-12-10 13:21MIT License
453System-generated table constraint names (constraints that involve one column)Find the names of database constraints that have been system-generated. Additional restrictions are that the constraints must involve only one column and are associated directly with a table (not through a domain). Names should follow the same style. If there is a mix of system-generated and user-defined names, then the style is most probably different.Problem detectionsystem catalog base tables only2021-12-10 12:47MIT License
454Mixing Concat and CoalesceFind cases where different means are used to deal with NULLs in case of concatenating texsts.Problem detectionINFORMATION_SCHEMA+system catalog base tables2021-12-08 14:25MIT License
455Perahaps 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
456Coalesce/Concat need at least two argumentsFind user-defined routines and derived tables (views/materialized views) that have a subquery that contain an invocation of Coalesce or Concat function with just one argument. You should use the Coalesce and Concat functions correctly by invoking these with at least two arguments. If one invokes these functions with one argument, then the functions will return the input value.Problem detectionINFORMATION_SCHEMA+system catalog base tables2021-12-08 11:49MIT License
457Mixing Concat and ||Find cases where different means are used to concatenate text within the same object.Problem detectionINFORMATION_SCHEMA+system catalog base tables2021-12-03 14:36MIT License
458Cycles in relationshipsFind as to whether foreign key constraints between tables form a cycle. For instance, if table C refers to table B, table B refers to table A, table A refers to table C and all the foreign key columns are mandatory, then one cannot add data to the tables. Is cycle value in the result should not contain value TRUE. One should check manually as to whether the foreign key columns are mandatory or optional.Problem detectionINFORMATION_SCHEMA+system catalog base tables2021-11-28 15:15MIT License
459Each table is both referencing and referenced table (perhaps there is a cycle in relationships)Find as to whether the relationships between tables form a complete bidirected graph. Tables are vertices in the graph. There is a directed edge between two vertices if one of the tables refers to another through foreign key relationship on mandatory columns.Problem detectionINFORMATION_SCHEMA+system catalog base tables2021-11-28 14:04MIT License
460Short cycle (columns)Find cases where two candidate keys of the same table that are also foreign keys reference to each other.Problem detectionsystem catalog base tables only2021-11-28 02:08MIT License