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...
621Perhaps 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
622Perhaps 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
623Perhaps 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
624Perhaps a routine does not have a real taskFind the routines where the only action is to return an argument value, a constant value, NULL or return the value of OLD or NEW variable in case of trigger functions.Problem detectionINFORMATION_SCHEMA+system catalog base tables2021-11-05 12:09MIT License
625Perhaps 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
626Perhaps a state machine is implemented with timestamp columnsFind implementations of state machines that uses a set of columns with a timestamp type.Problem detectionINFORMATION_SCHEMA only2021-03-26 21:04MIT License
627Perhaps a too generic foreign key column nameFind the names of foreign key columns that are too generic. The expressive names of table columns allow database users better and more quickly understand the meaning of data in the database. A person could participate in a process or be associated with an object due to different reasons. Thus, foreign key column names like isik_id, person_id, tootaja_id, worker_id etc. are too generic. The name should refer (also) to the reason why the person is connected.Problem detectionsystem catalog base tables only2023-03-15 18:27MIT License
628Perhaps a too long name, which has been automatically shortenedFind names (identifiers) of user-defined database objects that are 63 bytes long. This is the longest permitted length of identifiers if the default value of the NAMEDATALEN parameter has not been changed. PostgreSQL shortens too long identifiers automatically. Automatic code modification could break it somewhere.Problem detectionINFORMATION_SCHEMA+system catalog base tables2023-03-17 10:05MIT License
629Perhaps a too long PL/pgSQL routineA large routine may have multiple tasks that should be split between multiple routines, each of which has a more focused task. Find the PL/pgSQL routines where the number of physical lines of code is bigger than 20.Problem detectionINFORMATION_SCHEMA+system catalog base tables2024-01-04 16:38MIT License
630Perhaps a too long SQL routineA large routine may have multiple tasks that should be split between multiple routines that have a more focused task. Find the SQL routines where the number of statements (logical lines of code) is bigger than 5.Problem detectionINFORMATION_SCHEMA+system catalog base tables2024-01-04 16:39MIT License
631Perhaps a too simplified state machineFind base table columns with Boolean type that name refers to the possibility that these are used to register as to whether an entity is currently in active state or not. Find the base tables that have exactly one Boolean column. During the system design one should find all the possible states of an entity type that influence the behavior of the information system. Data as to whether an entity is in one of these states should be in the database. Having only two states - active/inactive - is sometimes a too big simplification.Problem detectionINFORMATION_SCHEMA only2021-03-27 03:08MIT License
632Perhaps a unneccessary surrogate keyFind base tables that have the primary key that is not a surrogate key and an alternate key that is a surrogate key. Perhaps the surrogate key column is not needed.Problem detectionINFORMATION_SCHEMA+system catalog base tables2021-03-07 20:59MIT License
633Perhaps 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
634Perhaps check constraint names contain incorrect or unnecessary wordsFind names of check constraints (either associated with a base table or a domain) that names contain words that are not needed in the name. For instance, constraints cannot ensure the correctness of data and thus the word correct should not be used in the names. Words like "valid" or phrases like "follows_rules" are just noise because all the constraint ensure that the registered data values are valid and follow certain rules.Problem detectionINFORMATION_SCHEMA+system catalog base tables2023-10-06 14:10MIT License
635Perhaps checking of file extension is incorrectFind check constraints of tables that use a regular expression to check as to whether a registered string ends with an appropriate file extension. However, the expression does not put the dot sign into the square brackets nor does have the escape character \before it, i.e., it is interpreted as a single character not as the dot sign in the expression. In regular expressions the dot (.) matches any single character except the newline character.Problem detectionINFORMATION_SCHEMA only2023-11-08 15:29MIT License
636Perhaps Count(*) is wrongly usedFind user-defined routines and derived tables (views/materialized views) that have a subquery that invokes Count aggregate function like this - Count(*), uses outer join, and grouping. In case of grouping you do not want to get an answer that an empty group contains one member.Problem detectionINFORMATION_SCHEMA+system catalog base tables2021-10-25 16:40MIT License
637Perhaps default value 'infinity' is missingFind optional base table columns that have a timestamp type and do not have a default value.Problem detectionINFORMATION_SCHEMA only2023-11-12 11:52MIT License
638Perhaps 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
639Perhaps excessive privileges to use base tablesFind excessive privileges to use base tabes (for others than the owner of the base table). The excessive privileges are all that are not SELECT, INSERT, UPDATE, DELETE.Problem detectionINFORMATION_SCHEMA+system catalog base tables2021-02-25 17:29MIT License
640Perhaps 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