| # | Name | Goal | Type ▲ | Data source | Last update | License | |
|---|---|---|---|---|---|---|---|
| 221 | User-defined routines with the same parameters (same name and type) regardless of the order of parameters | Find routines with the same parameters (same name and type) regardless of the order of parameters. Make sure that there is no accidental duplication. The query helps users to group together routines that probably have related tasks. | General | INFORMATION_SCHEMA+system catalog base tables | 2025-11-07 10:11 | MIT License | View |
| 222 | Using an internal data type - name | Find base table columns that use type name that is used in system catalog tables. It is not a problem if the column is meant for recording identifiers of database objects. | General | INFORMATION_SCHEMA only | 2025-11-07 10:11 | MIT License | View |
| 223 | Vacuum and analyze status of base tables | Find for each base table the last time when the table has been vacuumed or analyzed (either manually or automatically). | General | system catalog base tables only | 2025-11-07 10:11 | MIT License | View |
| 224 | Age columns in base and foreign tables | This query identifies columns in base and foreign tables that are intended to store age values. It detects these fields by analyzing both their naming conventions and data types. | Problem detection | INFORMATION_SCHEMA only | 2026-05-15 14:57 | MIT License | View |
| 225 | A getter does not return a value | Find user-defined SQL and PL/pgSQL routines that do not return a value although the name suggest that it should return a value (starts with "get"). | Problem detection | INFORMATION_SCHEMA+system catalog base tables | 2025-11-07 10:11 | MIT License | View |
| 226 | All-caps comments on derived tables and routines | This query identifies comments on derived tables (views) and routines that are 50 characters or longer and written entirely in uppercase letters. Writing long comments exclusively in capital letters should be avoided, as it significantly reduces readability and is generally perceived as shouting in digital communication. | Problem detection | INFORMATION_SCHEMA+system catalog base tables | 2026-06-02 13:48 | MIT License | View |
| 227 | All columns of a base table have a default value | Find base tables where all the columns have a default value. | Problem detection | INFORMATION_SCHEMA only | 2025-11-07 10:11 | MIT License | View |
| 228 | All the non-primary key columns are optional | Find base tables where all he non-primary key columns are optional. Avoid too many optional columns. You have to be extra careful with NULLs in case of formulating search conditions of data manipulation statements. | Problem detection | INFORMATION_SCHEMA only | 2025-11-07 10:11 | MIT License | View |
| 229 | All unique keys have at least one optional column | Find base tables where all unique keys (sets of columns covered by a unique constraint, or a unique index) have at least one optional column. In this case there can be rows in the table where the values that should identify the row are missing. Because NULL is not a value and is not duplicate of another NULL the, follwing is possible: CREATE TABLE Uniq(a INTEGER NOT NULL, b INTEGER, CONSTRAINT ak_uniq UNIQUE (a, b)); INSERT INTO Uniq(a, b) VALUES (1, NULL); INSERT INTO Uniq(a, b) VALUES (1, NULL); |
Problem detection | INFORMATION_SCHEMA+system catalog base tables | 2025-11-07 10:11 | MIT License | View |
| 230 | A non-parameterized table function instead of a view | Find table functions that do not have any parameters. Prefer simpler and more portable solutions. | Problem detection | INFORMATION_SCHEMA+system catalog base tables | 2025-11-07 10:11 | MIT License | View |
| 231 | A predefine character class has been incorrectly specified | Find regular expressions where a predefined character class is incorrectly specified, e.g. [digit] instead of [:digit:]. | Problem detection | INFORMATION_SCHEMA+system catalog base tables | 2025-11-07 10:11 | MIT License | View |
| 232 | A routine is invoked only once | Find user-defined routines that are invoked by exactly one user-defined routine. | Problem detection | INFORMATION_SCHEMA+system catalog base tables | 2025-11-07 10:11 | MIT License | View |
| 233 | A setter does not update a table | Find user-defined non-trigger SQL and PL/pgSQL routines that name starts with "set" (but not with "setting") but do not contain a UPDATE statement. | Problem detection | INFORMATION_SCHEMA+system catalog base tables | 2025-11-07 10:11 | MIT License | View |
| 234 | A state machine is implemented with the help of an enumeration type | Find implementations of state machines that uses an enumeration type. | Problem detection | INFORMATION_SCHEMA+system catalog base tables | 2025-11-07 10:11 | MIT License | View |
| 235 | A table has the same name as a routine | Find table names that are the same as some routine name. Use different names to avoid confusion. | Problem detection | INFORMATION_SCHEMA+system catalog base tables | 2025-11-07 10:11 | MIT License | View |
| 236 | Avoid using length function | This query identifies all expressions that use the non-standard length() function. Although length() is a functional synonym for char_length() in PostgreSQL, its use is discouraged for two primary reasons: char_length() is the SQL-standard function, and length() has different semantics in other database systems (e.g., returning byte length in MySQL). To enhance code portability and prevent semantic ambiguity for developers, this query flags all instances of length() to encourage standardization on the char_length() function. | Problem detection | INFORMATION_SCHEMA+system catalog base tables | 2025-11-13 12:53 | MIT License | View |
| 237 | Base table column name is the same as its domain name | Find base table columns that have the same name as the domain name or the data type name of the column. The names may have different uppercase/lowercase characters. Columns, domains, and types are different concepts in SQL and perhaps it is better to use different names in case of these. | Problem detection | INFORMATION_SCHEMA only | 2025-11-07 10:11 | MIT License | View |
| 238 | Base table column of comments/descriptions has an incorrect data type or maximum character length | Find base table columns that name refers to the possibility that these are used to register comments/descriptions. Find the columns where the data type is not VARCHAR and TEXT or in case of VARCHAR the maximum number of permitted characters is smaller than 1000. In case of determining field sizes choose a size that permits registration of all possible legal values. | Problem detection | INFORMATION_SCHEMA only | 2025-11-07 10:11 | MIT License | View |
| 239 | Base table column of measurements does not have a correct data type | This query identifies a semantic mismatch in data type selection for columns intended to store measurement data. It targets columns whose names imply a quantitative measurement (e.g., "length", "weight", "count", excluding boolean prefixes like "is_") but are not defined with a numeric data type (INTEGER, NUMERIC, etc.). Storing measurements as text (VARCHAR) prevents mathematical operations, aggregation, and proper sorting, and is considered a design flaw. | Problem detection | INFORMATION_SCHEMA only | 2025-12-03 19:19 | MIT License | View |
| 240 | Base table column of national identification numbers does not have a correct data type | Find non-textual base table columns that name refers to the possibility that these are used to register national identification numbers (personal codes). The codes can contain additional symbols to numbers. | Problem detection | INFORMATION_SCHEMA only | 2025-11-07 10:11 | MIT License | View |