| 461 |
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 |
2025-11-07 10:11 |
MIT License |
View |
| 462 |
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 |
2025-11-07 10:11 |
MIT License |
View |
| 463 |
Intra-object inconsistency in string concatenation methods |
This query detects internal inconsistency within individual database objects (user-defined routines, views, materialized views). It flags objects that utilize both the standard concatenation operator (||) and variadic concatenation functions (concat() or concat_ws()) within the same definition body. Mixing null-unsafe operators (||) with null-safe functions (concat) in a single routine suggests a lack of coherent logic or an incomplete refactoring effort, potentially leading to confusing behavior regarding NULL handling. |
Problem detection |
INFORMATION_SCHEMA+system catalog base tables |
2025-11-27 12:27 |
MIT License |
View |
| 464 |
Invalid character class |
PostgreSQL regular expressions do not have character classes word and letter. |
Problem detection |
INFORMATION_SCHEMA+system catalog base tables |
2025-11-07 10:11 |
MIT License |
View |
| 465 |
Invalid explicit locking with aggregate functions |
This query identifies SQL statements that attempt to apply explicit row locking (e.g., FOR SHARE, FOR UPDATE) to the result of an aggregate function (e.g., COUNT(*)). This is a semantic error because locking clauses operate on specific physical rows, whereas aggregate functions return a derived scalar value that is decoupled from the underlying row versions. To correctly enforce a lock, the query must select the specific columns (typically the primary key) of the target rows, rather than a computed aggregate. |
Problem detection |
INFORMATION_SCHEMA+system catalog base tables |
2025-12-10 12:59 |
MIT License |
View |
| 466 |
Invalid use of the case insensitive search modifier in regular expressions |
Find regular expression patterns that use (?i) modifier in any other place than at the beginning of the pattern or (?-i) in any place of the pattern. Such use of the modifiers is not supported by PostgreSQL. |
Problem detection |
INFORMATION_SCHEMA+system catalog base tables |
2025-11-07 10:11 |
MIT License |
View |
| 467 |
Invocation of a system-defined routine without providing any arguments |
Find user-defined routines that contain an invocation of a system-defined function without providing any argument. The query considers all aggregate functions as well as some popular scalar functions. |
Problem detection |
INFORMATION_SCHEMA+system catalog base tables |
2025-11-07 10:11 |
MIT License |
View |
| 468 |
Invocation of PL/pgSQL functions from the subqueries of derived tables |
Find derived tables that subqueries invoke a PL/pgSQL function. Avoid context switch that is caused by the invocation of PL/pgSQL functions from the subqueries of derived tables. |
Problem detection |
INFORMATION_SCHEMA+system catalog base tables |
2025-11-07 10:11 |
MIT License |
View |
| 469 |
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. |
Problem detection |
INFORMATION_SCHEMA only |
2025-11-07 10:11 |
MIT License |
View |
| 470 |
Is does not return a boolean |
This query identifies user-defined SQL and PL/pgSQL routines (excluding triggers) that exhibit a semantic inconsistency between their name and return type. It flags non-trigger routines whose names begin with a predicate prefix (e.g., is_, has_, can_, on_) but whose defined return type is not BOOLEAN. Such a mismatch violates the principle of self-documenting code, as the name creates a strong expectation of a TRUE/FALSE return value, which the routine's signature then contradicts. |
Problem detection |
INFORMATION_SCHEMA+system catalog base tables |
2025-11-13 14:03 |
MIT License |
View |
| 471 |
IS NOT DISTINCT FROM in derived tables |
Avoid using IS NOT DISTINCT FROM because it makes the query planner to avoid using an index. |
Problem detection |
INFORMATION_SCHEMA+system catalog base tables |
2025-11-07 10:11 |
MIT License |
View |
| 472 |
IS NOT DISTINCT FROM in routines |
Avoid using IS NOT DISTINCT FROM because it makes the query planner to avoid using an index. |
Problem detection |
INFORMATION_SCHEMA+system catalog base tables |
2025-11-07 10:11 |
MIT License |
View |
| 473 |
IS NULL check is probably not needed |
Find CHECK constraints that refer only to mandatory columns but the Boolean expression has IS NULL condition. |
Problem detection |
INFORMATION_SCHEMA only |
2025-11-07 10:11 |
MIT License |
View |
| 474 |
JSON type instead of JSONB type |
"In general, most applications should prefer to store JSON data as jsonb, unless there are quite specialized needs, such as legacy assumptions about ordering of object keys." (https://www.postgresql.org/docs/current/datatype-json.html) |
Problem detection |
INFORMATION_SCHEMA only |
2025-11-07 10:11 |
MIT License |
View |
| 475 |
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 |
2025-11-07 10:11 |
MIT License |
View |
| 476 |
Length and char_length functions are used within the same expression |
This query identifies expressions that use both the length() and char_length() functions, which is a strong indicator of a logical flaw. Since these functions are functional synonyms in PostgreSQL (both returning the character count), an expression that compares their results (e.g., length(col) > char_length(col)) may be either tautological or will always evaluate to false. Such code is typically written under the mistaken assumption that length() returns bytes, a behavior seen in other database management systems. |
Problem detection |
INFORMATION_SCHEMA+system catalog base tables |
2025-11-13 13:12 |
MIT License |
View |
| 477 |
Lifecycle not initiated |
Find non-primary key and non-unique base table foreign key columns that name refers to the possibility that these are used to register references to a state classifier. The column must belong to a foreign key and does not have a default value. |
Problem detection |
INFORMATION_SCHEMA+system catalog base tables |
2025-11-07 10:11 |
MIT License |
View |
| 478 |
LIKE instead of = |
Find expressions that use LIKE predicate for precise comparison. |
Problem detection |
INFORMATION_SCHEMA+system catalog base tables |
2025-11-07 10:11 |
MIT License |
View |
| 479 |
LIKE with a regular expression pattern |
Find expressions that use LIKE (including ILIKE) predicate with a regular expression patterns. In a LIKE pattern one can use only _ and % metasymbols to construct a pattern. |
Problem detection |
INFORMATION_SCHEMA+system catalog base tables |
2025-11-07 10:11 |
MIT License |
View |
| 480 |
LIKE without a pattern with % or _ |
Find expressions that use LIKE predicate witout a pattern that contains at least one % or _ sign. |
Problem detection |
INFORMATION_SCHEMA+system catalog base tables |
2025-11-07 10:11 |
MIT License |
View |