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.

#1041. Double negatives in Boolean expressions

INFORMATION_SCHEMA+system catalog base tables

Write code that is simple to understand and not confusing. A double negative is a grammatical construction occurring when two forms of negation are used in the same expression (https://en.wikipedia.org/wiki/Double_negative). Double negatives in Boolean expressions make it more difficult to understand and maintain the code.

Problem detection License: MIT (opens in new tab)

#1042. TG_ARGV is missing

INFORMATION_SCHEMA+system catalog base tables

Write correct code. If you pass arguments to a trigger function, then the function should use the arguments. TG_ARGV[]: "Data type array of text; the arguments from the CREATE TRIGGER statement. The index counts from 0. Invalid indexes (less than 0 or greater than or equal to tg_nargs) result in a null value." (PostgreSQL documentation)

Problem detection License: MIT (opens in new tab)

#1043. STATEMENT level triggers and ROW level AFTER triggers without RETURN NULL

INFORMATION_SCHEMA+system catalog base tables

Write correct code "The return value of a row-level trigger fired AFTER or a statement-level trigger fired BEFORE or AFTER is always ignored; it might as well be null." (PostgreSQL documentation)

Problem detection License: MIT (opens in new tab)

#1044. CHECK constraint cardinality is zero

INFORMATION_SCHEMA+system catalog base tables

Write correct constraints. Usually the constraint expression should refer to at least one column. A domain constraint expression should refer to the stub VALUE. For instance, the constraint CHECK(1=0) that is associated with a table T would prevent adding any rows to T. The value of the Boolean expression of this constraint is always FALSE.

Problem detection License: MIT (opens in new tab)

#1045. Non-predefined character classes must not be between double square brackets

INFORMATION_SCHEMA+system catalog base tables

Write correct regular expressions. For instance, if there is a rule that code must consist of one or more digits, then correct expression is code~'^[0-9]+$', not code~'^[[0-9]]+$'.

Problem detection License: MIT (opens in new tab)

#1046. Unbalanced brackets

INFORMATION_SCHEMA+system catalog base tables

Write expressions correctly. Find code fragments that have unbalanced brackets, i.e., the number of opening brackets is not the same as the number of closing brackets.

Problem detection License: MIT (opens in new tab)

#1047. search_path should not be between quotation marks

INFORMATION_SCHEMA+system catalog base tables

Write security definer functions securely. Give to the DBMS correctly information about the sequence of schemas that constitute the search path. You shouldn't write search path value between quotation marks or apostrophes. Thus, instead of writing SET search_path = "public, pg_temp"; or SET search_path = 'public, pg_temp'; you should write SET search_path = public, pg_temp;

Problem detection License: MIT (opens in new tab)

#1048. Procedures cannot have START TRANSACTION and SAVEPOINT

INFORMATION_SCHEMA+system catalog base tables

You cannot use a START TRANSACTION or a SAVEPOINT statement in a procedure. Procedures appeared in PostgreSQL 11.

Problem detection License: MIT (opens in new tab)

#1049. SECURITY DEFINER procedures cannot end transactions

INFORMATION_SCHEMA+system catalog base tables

You cannot use COMMIT and ROLLBACK in a SECURITY DEFINER procedure. Procedures appeared in PostgreSQL 11.

Problem detection License: MIT (opens in new tab)

#1050. Insufficient view privileges

INFORMATION_SCHEMA+system catalog base tables

You must give privileges to use views to the users/roles that correspond to applications

Problem detection License: MIT (opens in new tab)

#1051. Insufficient routine privileges

INFORMATION_SCHEMA+system catalog base tables

You must give rights to use routines to the users/roles that correspond to applications.

Problem detection License: MIT (opens in new tab)

#1052. Table privileges have been granted to PUBLIC

INFORMATION_SCHEMA only

You should follow the principle of least privilege and thus not have in your database tables that usage privileges are granted to the pseudo-role PUBLIC, i.e., to all the database users now and in the future.

Problem detection License: MIT (opens in new tab)

#1053. User-defined routine execution privilege has been granted to PUBLIC

INFORMATION_SCHEMA+system catalog base tables

You should follow the principle of least privilege and thus not have in your database user-defined routines that execution privilege is granted to PUBLIC, i.e., to all the database users now and in the future. By default, PostgreSQL gives routine execution privileges to PUBLIC.

Problem detection License: MIT (opens in new tab)

#1054. LEAKPROOF routines that are perhaps not leakproof

INFORMATION_SCHEMA+system catalog base tables

You should not give wrong information to the database management system.

Problem detection License: MIT (opens in new tab)

#1055. The total size of all indexes (system catalog excluded)

system catalog base tables only

Sofware measure License: MIT (opens in new tab)

#1056. The total size of all tables (system catalog excluded)

system catalog base tables only

Sofware measure License: MIT (opens in new tab)
# Name(activate to sort ascending) Goal(sorted ascending, activate to sort descending) Type(activate to sort ascending) Data source(activate to sort ascending) Last update(activate to sort ascending) License Actions
1041 Double negatives in Boolean expressions Write code that is simple to understand and not confusing. A double negative is a grammatical construction occurring when two forms of negation are used in the same expression (https://en.wikipedia.org/wiki/Double_negative). Double negatives in Boolean expressions make it more difficult to understand and maintain the code. Problem detection INFORMATION_SCHEMA+system catalog base tables MIT (opens in new tab) View (opens in new tab)
1042 TG_ARGV is missing Write correct code. If you pass arguments to a trigger function, then the function should use the arguments. TG_ARGV[]: "Data type array of text; the arguments from the CREATE TRIGGER statement. The index counts from 0. Invalid indexes (less than 0 or greater than or equal to tg_nargs) result in a null value." (PostgreSQL documentation) Problem detection INFORMATION_SCHEMA+system catalog base tables MIT (opens in new tab) View (opens in new tab)
1043 STATEMENT level triggers and ROW level AFTER triggers without RETURN NULL Write correct code "The return value of a row-level trigger fired AFTER or a statement-level trigger fired BEFORE or AFTER is always ignored; it might as well be null." (PostgreSQL documentation) Problem detection INFORMATION_SCHEMA+system catalog base tables MIT (opens in new tab) View (opens in new tab)
1044 CHECK constraint cardinality is zero Write correct constraints. Usually the constraint expression should refer to at least one column. A domain constraint expression should refer to the stub VALUE. For instance, the constraint CHECK(1=0) that is associated with a table T would prevent adding any rows to T. The value of the Boolean expression of this constraint is always FALSE. Problem detection INFORMATION_SCHEMA+system catalog base tables MIT (opens in new tab) View (opens in new tab)
1045 Non-predefined character classes must not be between double square brackets Write correct regular expressions. For instance, if there is a rule that code must consist of one or more digits, then correct expression is code~'^[0-9]+$', not code~'^[[0-9]]+$'. Problem detection INFORMATION_SCHEMA+system catalog base tables MIT (opens in new tab) View (opens in new tab)
1046 Unbalanced brackets Write expressions correctly. Find code fragments that have unbalanced brackets, i.e., the number of opening brackets is not the same as the number of closing brackets. Problem detection INFORMATION_SCHEMA+system catalog base tables MIT (opens in new tab) View (opens in new tab)
1047 search_path should not be between quotation marks Write security definer functions securely. Give to the DBMS correctly information about the sequence of schemas that constitute the search path. You shouldn't write search path value between quotation marks or apostrophes. Thus, instead of writing SET search_path = "public, pg_temp"; or SET search_path = 'public, pg_temp'; you should write SET search_path = public, pg_temp; Problem detection INFORMATION_SCHEMA+system catalog base tables MIT (opens in new tab) View (opens in new tab)
1048 Procedures cannot have START TRANSACTION and SAVEPOINT You cannot use a START TRANSACTION or a SAVEPOINT statement in a procedure. Procedures appeared in PostgreSQL 11. Problem detection INFORMATION_SCHEMA+system catalog base tables MIT (opens in new tab) View (opens in new tab)
1049 SECURITY DEFINER procedures cannot end transactions You cannot use COMMIT and ROLLBACK in a SECURITY DEFINER procedure. Procedures appeared in PostgreSQL 11. Problem detection INFORMATION_SCHEMA+system catalog base tables MIT (opens in new tab) View (opens in new tab)
1050 Insufficient view privileges You must give privileges to use views to the users/roles that correspond to applications Problem detection INFORMATION_SCHEMA+system catalog base tables MIT (opens in new tab) View (opens in new tab)
1051 Insufficient routine privileges You must give rights to use routines to the users/roles that correspond to applications. Problem detection INFORMATION_SCHEMA+system catalog base tables MIT (opens in new tab) View (opens in new tab)
1052 Table privileges have been granted to PUBLIC You should follow the principle of least privilege and thus not have in your database tables that usage privileges are granted to the pseudo-role PUBLIC, i.e., to all the database users now and in the future. Problem detection INFORMATION_SCHEMA only MIT (opens in new tab) View (opens in new tab)
1053 User-defined routine execution privilege has been granted to PUBLIC You should follow the principle of least privilege and thus not have in your database user-defined routines that execution privilege is granted to PUBLIC, i.e., to all the database users now and in the future. By default, PostgreSQL gives routine execution privileges to PUBLIC. Problem detection INFORMATION_SCHEMA+system catalog base tables MIT (opens in new tab) View (opens in new tab)
1054 LEAKPROOF routines that are perhaps not leakproof You should not give wrong information to the database management system. Problem detection INFORMATION_SCHEMA+system catalog base tables MIT (opens in new tab) View (opens in new tab)
1055 The total size of all indexes (system catalog excluded) Sofware measure system catalog base tables only MIT (opens in new tab) View (opens in new tab)
1056 The total size of all tables (system catalog excluded) Sofware measure system catalog base tables only MIT (opens in new tab) View (opens in new tab)