Filter Queries

Found 1056 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 the relatively small amount of data in the system catalog of a database.

#741. Perhaps excessive privileges to use base tables

INFORMATION_SCHEMA+system catalog 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 License: MIT (opens in new tab)

#742. Perhaps excessive privileges to use views

INFORMATION_SCHEMA+system catalog base tables

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 License: MIT (opens in new tab)

#743. Perhaps inconsistent use of temporal functions

INFORMATION_SCHEMA+system catalog base tables

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 License: MIT (opens in new tab)

#744. Perhaps inconsistent use of temporal functions (2)

INFORMATION_SCHEMA+system catalog base tables

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 License: MIT (opens in new tab)

#745. Perhaps incorrect default vale

INFORMATION_SCHEMA only

Find columns of base tables that have default value CURRENT_USER.

Problem detection License: MIT (opens in new tab)

#746. Perhaps incorrect use of 'NULL'

INFORMATION_SCHEMA+system catalog base tables

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 License: MIT (opens in new tab)

#747. Perhaps incorrect WHEN clause

INFORMATION_SCHEMA only

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 License: MIT (opens in new tab)

#748. Perhaps IS DISTINCT FROM should be used instead of <> in WHEN clauses

INFORMATION_SCHEMA only

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 License: MIT (opens in new tab)

#749. Perhaps is not snake_case - id, code, key, or nr is not followed by an underscore

INFORMATION_SCHEMA+system catalog base tables

Find names that perhaps do not use the snake_case naming style because the name starts with the phrase "id", "uuid", "code" , "kood", "key", or "nr" that is not followed by an underscore. Prefer snake_case over PascalCase and camelCase in names.

Problem detection License: MIT (opens in new tab)

#750. Perhaps is not snake_case - id, code, key, or nr is not preceded by an underscore

INFORMATION_SCHEMA+system catalog base tables

Find names that perhaps do not use the snake_case naming style because the name ends with the phrase "id", "uuid", "code", "kood", "key", or "nr" that is not preceded by an underscore. Prefer snake_case over PascalCase and camelCase in names.

Problem detection License: MIT (opens in new tab)

#751. Perhaps is not snake_case - long subsections without underscores

INFORMATION_SCHEMA+system catalog base tables

Find names that perhaps do not use the snake_case naming style because the name contains a long subsection (at least 20 characters) without underscores. Prefer snake_case over PascalCase and camelCase in names.

Problem detection License: MIT (opens in new tab)

#752. Perhaps last update time trigger is missing

INFORMATION_SCHEMA+system catalog base tables

Find base tables that have a column for last update time but the table does not have associated before update row level trigger for changing the last update time.

Problem detection License: MIT (opens in new tab)

#753. Perhaps primary key columns could be renamed

system catalog base tables only

Find the names of simple primary key columns that name does not follow the pattern _id or _code but it is quite similar.

Problem detection License: MIT (opens in new tab)

#754. Perhaps searching based on a name instead of a code

INFORMATION_SCHEMA+system catalog base tables

Find derived tables with a search condition that is possible based on a name instead of a code.

Problem detection License: MIT (opens in new tab)

#755. Perhaps spaces are unnecessarily restricted

INFORMATION_SCHEMA+system catalog base tables

Find base table columns that name refers to the possibility that the column is used to record names or textual descriptions but the column seems to have a simple check constraint that restricts spaces in these.

Problem detection License: MIT (opens in new tab)

#756. Perhaps the column type should be UUID

INFORMATION_SCHEMA only

Find base table columns that do not have uuid type but the name of the column refers to the possibility that the values in the column are uuid's.

Problem detection License: MIT (opens in new tab)

#757. Perhaps the name referes to multiple concepts

INFORMATION_SCHEMA+system catalog base tables

Find database objects that name contains words "and" (English) or "ja" (Estonian).

Problem detection License: MIT (opens in new tab)

#758. Perhaps the precision in case of a base table column with NUMERIC/DECIMAL type is too small

INFORMATION_SCHEMA only

Make sure that in case of using the type DECIMAL/NUMERIC as the type of a base table column the precision (the permitted number of digits in the number) is not too small. For instance, the biggest value in the type NUMERIC(1,1) is 0.9.

Problem detection License: MIT (opens in new tab)

#759. Perhaps the type of a base table column/domain should be BOOLEAN (based on types and default values)

INFORMATION_SCHEMA only

Find base table columns and domains that have a textual type and the default value that represents a truth-value. For instance, the type of a column could be VARCHAR and the column has the default value 'TRUE'.

Problem detection License: MIT (opens in new tab)

#760. Perhaps the type of a base table column/domain should be INTEGER/SMALLINT/BIGINT (based on sequence generators)

INFORMATION_SCHEMA only

Specify for each column/domain a right data type that takes into account expected values in the column/domain. Find base table columns and domains that refer to the nextval function by using the default value mechanism but do not have the type INTEGER, SMALLINT, or BIGINT. This check is performed in case of identity columns: ERROR: identity column type must be smallint, integer, or bigint.

Problem detection License: MIT (opens in new tab)
# Name(activate to sort ascending) Goal(activate to sort ascending) Type(activate to sort ascending) Data source(activate to sort ascending) Last update(sorted descending, activate to sort ascending) License Actions
741 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 MIT (opens in new tab) View (opens in new tab)
742 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 MIT (opens in new tab) View (opens in new tab)
743 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 MIT (opens in new tab) View (opens in new tab)
744 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 MIT (opens in new tab) View (opens in new tab)
745 Perhaps incorrect default vale Find columns of base tables that have default value CURRENT_USER. Problem detection INFORMATION_SCHEMA only MIT (opens in new tab) View (opens in new tab)
746 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 MIT (opens in new tab) View (opens in new tab)
747 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 MIT (opens in new tab) View (opens in new tab)
748 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 MIT (opens in new tab) View (opens in new tab)
749 Perhaps is not snake_case - id, code, key, or nr is not followed by an underscore Find names that perhaps do not use the snake_case naming style because the name starts with the phrase "id", "uuid", "code" , "kood", "key", or "nr" that is not followed by an underscore. Prefer snake_case over PascalCase and camelCase in names. Problem detection INFORMATION_SCHEMA+system catalog base tables MIT (opens in new tab) View (opens in new tab)
750 Perhaps is not snake_case - id, code, key, or nr 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 "id", "uuid", "code", "kood", "key", or "nr" that is not preceded by an underscore. Prefer snake_case over PascalCase and camelCase in names. Problem detection INFORMATION_SCHEMA+system catalog base tables MIT (opens in new tab) View (opens in new tab)
751 Perhaps is not snake_case - long subsections without underscores Find names that perhaps do not use the snake_case naming style because the name contains a long subsection (at least 20 characters) without underscores. Prefer snake_case over PascalCase and camelCase in names. Problem detection INFORMATION_SCHEMA+system catalog base tables MIT (opens in new tab) View (opens in new tab)
752 Perhaps last update time trigger is missing Find base tables that have a column for last update time but the table does not have associated before update row level trigger for changing the last update time. Problem detection INFORMATION_SCHEMA+system catalog base tables MIT (opens in new tab) View (opens in new tab)
753 Perhaps primary key columns could be renamed Find the names of simple primary key columns that name does not follow the pattern _id or _code but it is quite similar. Problem detection system catalog base tables only MIT (opens in new tab) View (opens in new tab)
754 Perhaps searching based on a name instead of a code Find derived tables with a search condition that is possible based on a name instead of a code. Problem detection INFORMATION_SCHEMA+system catalog base tables MIT (opens in new tab) View (opens in new tab)
755 Perhaps spaces are unnecessarily restricted Find base table columns that name refers to the possibility that the column is used to record names or textual descriptions but the column seems to have a simple check constraint that restricts spaces in these. Problem detection INFORMATION_SCHEMA+system catalog base tables MIT (opens in new tab) View (opens in new tab)
756 Perhaps the column type should be UUID Find base table columns that do not have uuid type but the name of the column refers to the possibility that the values in the column are uuid's. Problem detection INFORMATION_SCHEMA only MIT (opens in new tab) View (opens in new tab)
757 Perhaps the name referes to multiple concepts Find database objects that name contains words "and" (English) or "ja" (Estonian). Problem detection INFORMATION_SCHEMA+system catalog base tables MIT (opens in new tab) View (opens in new tab)
758 Perhaps the precision in case of a base table column with NUMERIC/DECIMAL type is too small Make sure that in case of using the type DECIMAL/NUMERIC as the type of a base table column the precision (the permitted number of digits in the number) is not too small. For instance, the biggest value in the type NUMERIC(1,1) is 0.9. Problem detection INFORMATION_SCHEMA only MIT (opens in new tab) View (opens in new tab)
759 Perhaps the type of a base table column/domain should be BOOLEAN (based on types and default values) Find base table columns and domains that have a textual type and the default value that represents a truth-value. For instance, the type of a column could be VARCHAR and the column has the default value 'TRUE'. Problem detection INFORMATION_SCHEMA only MIT (opens in new tab) View (opens in new tab)
760 Perhaps the type of a base table column/domain should be INTEGER/SMALLINT/BIGINT (based on sequence generators) Specify for each column/domain a right data type that takes into account expected values in the column/domain. Find base table columns and domains that refer to the nextval function by using the default value mechanism but do not have the type INTEGER, SMALLINT, or BIGINT. This check is performed in case of identity columns: ERROR: identity column type must be smallint, integer, or bigint. Problem detection INFORMATION_SCHEMA only MIT (opens in new tab) View (opens in new tab)