| 381 |
Grantable privileges on the database and its schemas, domains, types, languages, sequences, foreign data wrappers, and foreign servers |
Find privileges on the database and its schemas, domains, types, languages, sequences, foreign data wrappers, and foreign servers that the carrier of the privilege can in turn grant to others, i.e., the privileges have been given WITH GRANT OPTION. The number of privileges that can be passed on should be as small as possible. |
Problem detection |
system catalog base tables only |
2025-11-07 10:11 |
MIT License |
View |
| 382 |
Grantable roles |
Find roles that a member can grant to others, i.e., the role has been granted with ADMIN OPTION. The number of privileges that can be passed on should be as small as possible. |
Problem detection |
system catalog base tables only |
2025-11-07 10:11 |
MIT License |
View |
| 383 |
Grantable routine privileges |
Find routine privileges that the carrier of the privilege can in turn grant to others, i.e., the privileges have been given WITH GRANT OPTION. The number of privileges that can be passed on should be as small as possible. |
Problem detection |
INFORMATION_SCHEMA+system catalog base tables |
2025-11-07 10:11 |
MIT License |
View |
| 384 |
Grantable table privileges |
Find table privileges that the carrier of the privilege can in turn grant to others, i.e., the privileges have been given WITH GRANT OPTION. The number of privileges that can be passed on should be as small as possible. |
Problem detection |
INFORMATION_SCHEMA+system catalog base tables |
2025-11-07 10:11 |
MIT License |
View |
| 385 |
Grantable usage privileges |
Find usage privileges that the carrier of the privilege can in turn grant to others, i.e., the privileges have been given WITH GRANT OPTION. The number of privileges that can be passed on should be as small as possible. |
Problem detection |
INFORMATION_SCHEMA+system catalog base tables |
2025-11-07 10:11 |
MIT License |
View |
| 386 |
Granted roles |
Find membership relations between roles. |
General |
system catalog base tables only |
2025-11-07 10:11 |
MIT License |
View |
| 387 |
Grantees |
Database must be used by users who have minimal set of privileges for performing tasks. The query helps to find out as to whether some user/role other than PUBLIC and a superuser have rights to use tables and routines of the database. |
General |
INFORMATION_SCHEMA only |
2025-11-07 10:11 |
MIT License |
View |
| 388 |
Gratuitous context in the names of foreign key columns |
Find foreign key columns that name contains twice the name of the referenced (primary) table. |
Problem detection |
system catalog base tables only |
2025-11-07 10:12 |
MIT License |
View |
| 389 |
Gratuitous context in the names of non-foreign key and non-primary key columns |
This query identifies base table columns that unnecessarily include the table name. It searches for columns that are not part of a primary or foreign key and contain the name of their parent table. To avoid flagging legitimate naming conventions, it explicitly excludes a list of generic column names (e.g., name, description, nimi, kommentaar) where prefixing with the table name is considered good practice for improving clarity in queries. |
Problem detection |
INFORMATION_SCHEMA+system catalog base tables |
2025-12-05 10:01 |
MIT License |
View |
| 390 |
Gratuitous context in the names of parameters |
This query enforces a concise coding style by checking the names of parameters within routines (such as functions or procedures). It finds parameters whose names unnecessarily repeat the name of the routine they belong to. For example, in a function named calculate_invoice, a parameter named calculate_invoice_id would be flagged, as invoice_id is sufficient. A routine cannot have two parameters with the same name, so the shorter name is unambiguous within the context of the routine and results in cleaner, more readable code. |
Problem detection |
INFORMATION_SCHEMA+system catalog base tables |
2025-11-07 10:12 |
MIT License |
View |
| 391 |
Gratuitous context in the names of schema objects |
This query identifies schema objects with names that are redundantly prefixed with their own schema's name. It flags any object whose name begins with the schema name plus at least one other character. This enforces the design principle that a schema is a sufficient namespace, and therefore, objects within it do not require the additional, repetitive context in their own names. |
Problem detection |
system catalog base tables only |
2025-11-07 10:12 |
MIT License |
View |
| 392 |
Identical indexes |
Find indexes that are identical, i.e., have the same properties, including uniqueness. The query considers all types of indexes, including indexes that have been automatically created to support a constraint and function-based indexes. |
Problem detection |
system catalog base tables only |
2025-11-07 10:11 |
MIT License |
View |
| 393 |
Identifiers that explicitly say that they carry no meaning |
Find identifiers that explicitly say that they carry no meaning. Such identifier is called "unnamed" or "anonymous". |
Problem detection |
INFORMATION_SCHEMA+system catalog base tables |
2025-11-07 10:11 |
MIT License |
View |
| 394 |
Identity columns configured as GENERATED BY DEFAULT |
This query identifies identity columns defined with the GENERATED BY DEFAULT clause. Unlike GENERATED ALWAYS, this configuration permits manual insertion of values into the identity column without explicit overrides. This flexibility creates a significant risk of sequence desynchronization: if a user manually inserts a key value that exceeds the current sequence state, the sequence will eventually generate a colliding value. This results in runtime unique constraint violations (primary key conflicts) that are difficult to predict and resolve. The preferred pattern for surrogate keys is typically GENERATED ALWAYS to enforce system-controlled uniqueness. |
Problem detection |
INFORMATION_SCHEMA only |
2025-12-26 14:45 |
MIT License |
View |
| 395 |
Inadequate length constraints on address-related columns |
This query identifies base table columns designated for storing address components (e.g., ip addres e-mail, telephone number, physical location) that lack appropriate length constraints reflecting real-world data requirements. It operates on a heuristic basis, targeting columns whose identifiers imply address data (e.g., names containing "addr" or "mail") but whose definitions fail to account for standard maximum lengths. This includes both insufficient allocation (truncation risk) and unbounded allocation (data quality risk). Ensuring these fields are sized according to domain standards is crucial for data integrity and usability. |
Problem detection |
INFORMATION_SCHEMA only |
2026-01-21 09:04 |
MIT License |
View |
| 396 |
Inappropriate field size or data type for column that strores database username |
Find columns of base tables that based on the default value of the column contain database username. However, the type of the column is not VARCHAR(63) or VARCHAR(128). |
Problem detection |
INFORMATION_SCHEMA only |
2025-11-07 10:11 |
MIT License |
View |
| 397 |
Inappropriate use of trim function in whitespace constraints |
This query identifies a semantic mismatch between the name and implementation of CHECK constraints (on tables, foreign tables, or domains). It targets constraints whose names suggest they validate against whitespace-only strings (e.g., names containing 'whitespace', 'space', 'blank'), but whose logic inappropriately uses the trim() function. The trim() function is a formatting tool for removing leading/trailing spaces, not a validation tool for ensuring a string is not composed entirely of whitespace. This indicates a likely implementation error, as a more robust regular expression (e.g., column !~ '^\s*$') is the correct tool for this type of validation. |
Problem detection |
INFORMATION_SCHEMA+system catalog base tables |
2025-11-15 12:34 |
MIT License |
View |
| 398 |
Inconsistency between the name and the type of a base table column (dates) |
Find base table columns that name refers to the possibility that these are used to register dates. Find the columns that do not have an appropriate data type. Column names should reflect the data that is possible to record in the column. For instance, in case of temporal data the column name should indicate as to whether we record dates or timestamps. If the column data type is "date", then the suffix of the column name should be "kp" (Estonian) or "date" (English). |
Problem detection |
INFORMATION_SCHEMA only |
2025-11-07 10:11 |
MIT License |
View |
| 399 |
Inconsistency between the name and the type of a base table column (timestamps) |
Find base table columns that name refers to the possibility that these are used to register timestamps. Find the columns that do not have an appropriate data type. Column names should reflect the data that is possible to record in the column. For instance, in case of temporal data the column name should indicate as to whether we record dates or timestamps. If the column type is "timestamp", then the suffix of the column name should be "aeg" (Estonian) or "time" (English). |
Problem detection |
INFORMATION_SCHEMA only |
2025-11-07 10:11 |
MIT License |
View |
| 400 |
Inconsistency between the type and the default value of a column (date and timestamp values) |
Find table columns with timestamp/date types that data type and dynamically found default value have a different type. |
Problem detection |
INFORMATION_SCHEMA only |
2025-11-07 10:11 |
MIT License |
View |