Filter Queries

Found 997 queries.

  • All the queries about database objects contain a subcondition to exclude from the result information about the system catalog.
  • Although the statements use SQL constructs (common table expressions; NOT in subqueries) that could cause performance problems in case of large datasets it shouldn't be a problem in case of relatively small amount of data, which is in the system catalog of a database.
  • Statistics about the catalog content and project home in GitHub that has additional information.

# Name Goal Type Data source Last update License
621 Perhaps a unneccessary surrogate key Find 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 detection INFORMATION_SCHEMA+system catalog base tables 2021-03-07 20:59 MIT License View
622 Perhaps brackets are missing in a regular expression that uses OR logical operation Find 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 detection INFORMATION_SCHEMA+system catalog base tables 2023-11-09 20:22 MIT License View
623 Perhaps character class [[:alnum:]] could be used Perhaps regular expressions that refer to character classes alnum and digit could be simplified. Problem detection INFORMATION_SCHEMA+system catalog base tables 2024-11-02 09:32 MIT License View
624 Perhaps check constraint names contain incorrect or unnecessary words Find 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 detection INFORMATION_SCHEMA+system catalog base tables 2023-10-06 14:10 MIT License View
625 Perhaps checking of file extension is incorrect Find 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 detection INFORMATION_SCHEMA only 2023-11-08 15:29 MIT License View
626 Perhaps CHECK should be associated with a domain Find cases where multiple columns with the same domain have exactly the same CHECK constraint that is directly associated with the table. Problem detection INFORMATION_SCHEMA+system catalog base tables 2024-11-23 15:03 MIT License View
627 Perhaps Count(*) is wrongly used Find 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 detection INFORMATION_SCHEMA+system catalog base tables 2021-10-25 16:40 MIT License View
628 Perhaps default value 'infinity' is missing Find optional base table columns that have a timestamp type and do not have a default value. Problem detection INFORMATION_SCHEMA only 2024-11-28 14:58 MIT License View
629 Perhaps 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 detection INFORMATION_SCHEMA+system catalog base tables 2021-12-20 11:30 MIT License View
630 Perhaps excessive privileges to use base tables Find 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 detection INFORMATION_SCHEMA+system catalog base tables 2021-02-25 17:29 MIT License View
631 Perhaps excessive privileges to use views Find 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 detection INFORMATION_SCHEMA+system catalog base tables 2021-02-25 17:29 MIT License View
632 Perhaps inconsistent use of temporal functions Find routines that use temporal functions CURRENT_TIMESTAMP, LOCALTIMESTAMP, or now() that is inconsistent with the default values of the columns that are used by the routine, e.g., function uses a column with the default value LOCALTIMESTAMP but the routine uses function CURRENT_TIMESTAMP or now(). Problem detection INFORMATION_SCHEMA+system catalog base tables 2023-12-10 17:11 MIT License View
633 Perhaps inconsistent use of temporal functions (2) Find as to whether in the same database more than one of these functions is used at the same time - now(), localtimestamp, current_timestamp. Problem detection INFORMATION_SCHEMA+system catalog base tables 2024-12-12 00:20 MIT License View
634 Perhaps incorrect check of permitted timestamp values Find 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 detection INFORMATION_SCHEMA+system catalog base tables 2023-11-09 10:27 MIT License View
635 Perhaps incorrect column name (based on default values) Find columns of base tables that have the default value CURRENT_USER or SESSION_USER but the name of the column does not refer to the fact that it contains usernames. Problem detection INFORMATION_SCHEMA only 2024-01-01 12:14 MIT License View
636 Perhaps incorrect default vale Find columns of base tables that have default value CURRENT_USER. Problem detection INFORMATION_SCHEMA only 2023-12-30 11:32 MIT License View
637 Perhaps incorrect use of 'NULL' Find Boolean expressions, queries, routines, and default values that refer to value 'NULL'. Perhaps NULL was intended instead. 'NULL' is a string (a value) but NULL is a special marker for denoting missing value. Problem detection INFORMATION_SCHEMA+system catalog base tables 2021-11-04 13:19 MIT License View
638 Perhaps incorrect WHEN clause Find row level triggers that have action condition (WHEN clause) but the Boolean expression in its specifications does not refer to neither NEW nor OLD variable. Problem detection INFORMATION_SCHEMA only 2021-02-25 17:30 MIT License View
639 Perhaps IS DISTINCT FROM should be used instead of <> in WHEN clauses Use a right predicate in trigger condition in order to ensure that the trigger executes always when it has to but not more often. IS DISTINCT FROM treats NULL as if it was a known value, rather than unknown. It would be relevant if a column that is referenced in the action condition is optional, i.e., permits NULLs. General INFORMATION_SCHEMA only 2024-12-23 12:27 MIT License View
640 Perhaps is not a snake case - date, time, or by is not preceded by an underscore Find names that perhaps do not use the snake_case naming style because the name ends with the phrase "date", "time", "by" that is not preceded by an underscore. Prefer snake_case over PascalCase and camelCase in names. Problem detection INFORMATION_SCHEMA+system catalog base tables 2024-12-23 13:56 MIT License View