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...
581Patterns 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
582Patterns 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
583Patterns 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
584Perahaps 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
585Percentage of optional columns in each base tableWhat is the percentage of optional columns (that permit NULLs) in case of each base table? It is better to prohibit the use of NULLs in as many columns as possible. Otherwise the results of queries may be misleading.Sofware measureINFORMATION_SCHEMA only2020-11-08 20:55MIT License
586Percentage of the total index storage size from the total database storage size (system catalog included)Get overview of disk usage.Sofware measuresystem catalog base tables only2020-11-06 14:51MIT License
587Perhaps 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
588Perhaps 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
589Perhaps a CHECK constraint about the combination of truth values is missingFind base tables that have at least two columns that have Boolean type and have at least one Boolean column that is not covered by a CHECK constraint involving more than one Boolean column. The Boolean columns possibly mean that we want to record data about states. Often the states depend on each other. For instance, if an order is archived it must be inactive.Problem detectionINFORMATION_SCHEMA+system catalog base tables2021-02-25 17:29MIT License
590Perhaps a CHECK constraint about the order of events is missingFind base tables that have at least two columns that have DATE or TIMESTAMP (with or without time zone) type and do not have any associated CHECK constraint that involves two or more of these columns. The columns mean that we want to record data about events or processes, which often have a certain order. Hence, in case of each row of such a table the values in these columns must be in a certain order. For instance, the end of a meeting cannot be earlier than the beginning of the meeting.Problem detectionINFORMATION_SCHEMA+system catalog base tables2021-02-25 17:29MIT License
591Perhaps an existing domain could be used to define the properties of a base table column?Find non-foreifgn key base table columns that have not been defined based on a domain but that have the same properties (data type, field size, default value, and pemisson to use NULLs) as some domain. If you define a domain, then you should try to use it in case of multiple columns.Problem detectionINFORMATION_SCHEMA+system catalog base tables2021-02-25 17:29MIT License
592Perhaps an inconsistent use of NO ACTION and RESTRICT in the foreign key declarationsFind as to whether in case of foreign key constraints both the compensating actions RESTRICT and NO ACTION are used within the same database. If the same thing has to do in different places, then try to do it in the same way.Problem detectionsystem catalog base tables only2021-02-25 17:29MIT License
593Perhaps an overcomplicated constraint expression that compares the result of a Boolean expression with a Boolean valueFind table and domain CHECK constraints that compare the result of a Boolean expression with a Boolean value. If you can choose between two logically equivalent Boolean expressions choose the more simple expression.Problem detectionINFORMATION_SCHEMA+system catalog base tables2023-12-30 11:57MIT License
594Perhaps an unnecessary default value (the empty string or a string that consists of only whitespace) of a base table column/domainFind table columns and domains with the default value that is the empty string or a string that consists of only whitespace (for instance, newlines, spaces).Problem detectionINFORMATION_SCHEMA only2021-03-20 11:42MIT License
595Perhaps 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
596Perhaps a redundant column (based on sequence generators)Find base tables where more than one column gets the default value by using the sequence generator mechanism.Problem detectionINFORMATION_SCHEMA only2021-03-05 09:42MIT License
597Perhaps a reference to the variable NEW is missingFind row level before insert and before update triggers that only task is not to raise an exception and where the variable NEW is not used in the trigger routine outside the RETURN clause.Problem detectionINFORMATION_SCHEMA+system catalog base tables2023-12-21 20:34MIT License
598Perhaps a reference to the variable OLD is missingFind row level before delete triggers that only task is not to raise an exception and where the variable OLD is not used in the trigger routine outside the RETURN clause.Problem detectionINFORMATION_SCHEMA+system catalog base tables2023-12-21 19:29MIT License
599Perhaps a regular expression could be simplifiedFind regular expressions that name character classes a-zA-Z.Problem detectionINFORMATION_SCHEMA+system catalog base tables2021-11-04 16:19MIT License
600Perhaps a relationship should be irreflexiveEnforce all the constraints. A binary relation is called irreflexive, if it does not relate any element to itself.Problem detectionsystem catalog base tables only2021-02-25 17:29MIT License