| 421 |
Inconsistent prefixing of generic column names |
This query validates column naming consistency, specifically targeting generic attributes such as comments or descriptions. It flags tables that exhibit a mixed convention: containing both prefixed (e.g., table_comment) and unprefixed (e.g., description) generic columns within the same database context. This excludes primary and foreign keys. The goal is to enforce a uniform style—either consistently prefixing generic columns with the table name or consistently omitting the prefix—rather than allowing a hybrid approach. |
Problem detection |
INFORMATION_SCHEMA+system catalog base tables |
2025-12-05 09:44 |
MIT License |
View |
| 422 |
Inconsistent prefixing of specific (non-generic) column names |
This query audits the database for inconsistent column naming conventions, specifically focusing on non-generic, domain-specific attributes (excluding primary keys, foreign keys, and generic fields like 'comment'). It detects a hybrid naming strategy: some columns are prefixed with the table name (e.g., employee_salary) and others are not (e.g., hiring_date). This inconsistency suggests a lack of a standardized data dictionary, making query writing unpredictable. |
Problem detection |
INFORMATION_SCHEMA+system catalog base tables |
2025-12-05 10:15 |
MIT License |
View |
| 423 |
Inconsistent referencing to character classes |
Find as to whether regular expressions use inconsistently references to character classes: [^\s], [^\d], [^\w], [^[:space:]], [^[:digit:]], [^[:word:]] vs [^\S], [^\D], [^\W]. |
Problem detection |
INFORMATION_SCHEMA+system catalog base tables |
2025-11-07 10:11 |
MIT License |
View |
| 424 |
Inconsistent regex character class syntax usage |
This query audits regular expressions across the database to detect inconsistent syntax when defining character classes. It specifically checks for the concurrent usage of Perl-style shorthand notation (e.g., \s, \d) and POSIX character classes (e.g., [[:space:]], [[:digit:]]). While often functionally overlapping, these syntaxes may have subtle behavioral differences depending on locale and engine versions. The presence of both styles within a single database indicates a lack of coding standards, reducing readability and increasing maintenance complexity. |
Problem detection |
INFORMATION_SCHEMA+system catalog base tables |
2025-11-20 13:12 |
MIT License |
View |
| 425 |
Inconsistent syntax for whitespace validation constraints |
This query audits the database schema for syntactical inconsistency in CHECK constraints designed to prohibit empty or whitespace-only strings. It identifies the concurrent use of disparate expression patterns—such as column ~ '\S', column !~ '^[[:space:]]*$', or trim(column) <> ''—to achieve the same functional validation. While these patterns may enforce identical logical rules, the lack of a single, standardized idiom increases cognitive load and maintenance complexity. The query facilitates a review to select one preferred syntax and enforce its uniform application across all relevant columns. |
Problem detection |
INFORMATION_SCHEMA+system catalog base tables |
2025-11-19 15:00 |
MIT License |
View |
| 426 |
Inconsistent usage of string concatenation methods within or accross different database objects |
This query audits the database schema to assess the consistency of string concatenation practices. It identifies the concurrent usage of multiple disparate methods for joining text: the standard concatenation operator (||) and the variadic functions concat() and concat_ws(). While each method has specific use cases (e.g., concat for null safety), indiscriminate mixing of these techniques across similar contexts indicates a lack of coding standards. The output facilitates a review to enforce a more uniform approach where appropriate. |
Problem detection |
INFORMATION_SCHEMA+system catalog base tables |
2025-12-13 14:49 |
MIT License |
View |
| 427 |
Inconsistent use of casting syntax in routines |
Find as to whether PL/pgSQL routines and SQL routines that do not have SQL-standard body use different syntax for casting (cast function vs :: operator). |
Problem detection |
INFORMATION_SCHEMA+system catalog base tables |
2025-11-07 10:11 |
MIT License |
View |
| 428 |
Inconsistent use of functions and procedures |
Find as to whether the database has both procedures as well as functions that do not return a value (i.e., return VOID). Such routines are generally used to modify data in the database. The support of procedures was added to PostgreSQL 11. |
Problem detection |
INFORMATION_SCHEMA+system catalog base tables |
2025-11-07 10:11 |
MIT License |
View |
| 429 |
Inconsistent use of gratuitous context in the names of non-foreign key and non-primary key columns |
This query validates column naming conventions. It returns a row only for tables that have an inconsistent mix of column naming styles—specifically, where some columns (that are not part of a primary or foreign key) are prefixed with the table name and others are not. |
Problem detection |
INFORMATION_SCHEMA+system catalog base tables |
2025-12-05 10:12 |
MIT License |
View |
| 430 |
Inconsistent use of length and char_length functions |
This query identifies inconsistent usage of string length functions within the database. Although length() and char_length() are functional synonyms in PostgreSQL (both returning the character count), mixing them violates clean coding principles. The query checks if both variants are present in the codebase, flagging a lack of standardization. Enforcing a single choice (typically the SQL-standard char_length or character_length) improves code maintainability and readability. |
Problem detection |
INFORMATION_SCHEMA+system catalog base tables |
2025-11-13 12:56 |
MIT License |
View |
| 431 |
Inconsistent use of older and newer join syntax in the subqueries of derived tables |
Find as to whether the subqueries of derived tables use both older join syntax (join condition in the where clause) and newer syntax (join condition in the from clause). |
Problem detection |
INFORMATION_SCHEMA+system catalog base tables |
2025-11-07 10:11 |
MIT License |
View |
| 432 |
Inconsistent use of plural and singular in column names in the context of a relationship (English version) |
Find foreign key constraints that cover one column in case of which the name of refererenced/referencing column is in plural and the name of referencing/refererenced column is in singular. |
Problem detection |
INFORMATION_SCHEMA+system catalog base tables |
2025-11-07 10:11 |
MIT License |
View |
| 433 |
Inconsistent use of plural and singular in table names in the context of a relationship (English version) |
Find foreign key constraints in case of which the name of one of the tables is in plural and the name of another table is in singular. |
Problem detection |
INFORMATION_SCHEMA+system catalog base tables |
2025-11-07 10:11 |
MIT License |
View |
| 434 |
Inconsistent use of plural and singular in table names in the context of a relationship (Estonian version) |
Find foreign key constraints in case of which the name of one of the tables is in plural and the name of another table is in singular. |
Problem detection |
INFORMATION_SCHEMA+system catalog base tables |
2025-11-07 10:11 |
MIT License |
View |
| 435 |
Inconsistent use of session_user and current_user functions |
Find as to whether both functions session_user and current_user are used in the database. |
Problem detection |
INFORMATION_SCHEMA+system catalog base tables |
2025-11-07 10:11 |
MIT License |
View |
| 436 |
Incorrect characterization of a user-defined routine as an "immutable" routine |
Find immutable routines that contain SELECT statements from a database (including SELECT .. FOR UPDATE), INSERT, UPDATE, DELETE, or LOCK statement. The DBMS should get a correct background information about the behaviour of a routine. Immutable routines should not have side effects and should also not ask data from a database because it could change over time. Immutable routines cannot lock tables or its specific rows. |
Problem detection |
INFORMATION_SCHEMA+system catalog base tables |
2025-11-07 10:11 |
MIT License |
View |
| 437 |
Incorrect characterization of a user-defined routine as a "stable" routine |
Find stable routines that contain INSERT, UPDATE, DELETE, SELECT … FOR UPDATE, or LOCK statement. The DBMS should get a correct background information about the behaviour of a routine. Stable routines cannot modify data in a database, lock tables, or its specific rows. |
Problem detection |
INFORMATION_SCHEMA+system catalog base tables |
2025-11-07 10:11 |
MIT License |
View |
| 438 |
Incorrect check of NULLs |
Find the use of =NULL and <>NULL in case of table level check constraints, domain level check constraints, WHEN clauses of triggers, WHERE clauses of rules, subqueries of derived tables, and bodies of routines. Write correct code. In order to determine as to whether a value is missing or not one has to use the IS [NOT] NULL predicate. NULL is the marker in SQL that denotes a missing value. Although it is often called "NULL value", one cannot treat it as an ordinary value, i.e., use it in comparisons as a value. |
Problem detection |
INFORMATION_SCHEMA+system catalog base tables |
2025-11-07 10:11 |
MIT License |
View |
| 439 |
Incorrect comparison operator |
Find PL/pgSQL routines that use comparison operators =< or =>. |
Problem detection |
INFORMATION_SCHEMA+system catalog base tables |
2025-11-07 10:11 |
MIT License |
View |
| 440 |
Incorrect password hash update |
Find row level update triggers that incorrectly implement update of password hash. It should not be that the new password hash is calculated based on the existing hash. |
Problem detection |
INFORMATION_SCHEMA+system catalog base tables |
2025-11-07 10:11 |
MIT License |
View |