Filter Queries

Found 18 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 relatively small amount of data, which is in the system catalog of a database.
  • Statistics about the catalog content and project home in GitHub that has additional information.

# Name Goal Type Data source Last update License
1 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
2 Base table column of personal names does not restrict the maximum character length This query identifies base table columns that, based on their name, are presumed to store personal names but lack an explicit maximum length constraint. It operates on a heuristic, flagging columns with names like first_name, surname, etc., that are defined with unbounded textual types (e.g., text, varchar) and have no corresponding CHECK constraint to limit their length (e.g., char_length(col) <= n). The absence of such a limit is a design flaw that can introduce usability issues in front-end applications and create potential security vulnerabilities related to excessive data submission. Problem detection INFORMATION_SCHEMA+system catalog base tables 2025-11-13 13:04 MIT License View
3 Base table column of personal names has questionable properties Find base table columns that name refers to the possibility that these are used to register personal names. Although there are very long personal names the general approach is to register a shortened version of these. Thus, a large field size is not a good idea because it would cause usability and security problems. There are persons who only have one name component (mononymous persons). Database design must take it into account. Problem detection INFORMATION_SCHEMA only 2025-11-07 10:11 MIT License View
4 Base table columns with the same name and type have different field sizes Find base table columns that have the same name and type but different field size. Problem detection INFORMATION_SCHEMA only 2025-11-07 10:11 MIT License View
5 Checking the text maximum length with CHECK This query identifies all base table columns that enforce a maximum value length through the use of a CHECK constraint. It specifically searches for constraint definitions that contain length-calculating functions (such as length(), char_length(), or similar patterns) to provide a comprehensive list of all columns where data length is explicitly managed by a business rule at the database level. General system catalog base tables only 2025-11-13 13:05 MIT License View
6 Different character maximum lengths that are used to define textual base table columns Find the number of different character maximum lengths that are used to define textual base table columns as well as list all the different lengths. Show also the total number of columns with char/varchar type. Maximum character length constrains values in a column. Thus, in case there is a small number of used lengths, it raises a question as to whether the lengths have been optimally selected. Sofware measure INFORMATION_SCHEMA only 2025-11-07 10:11 MIT License View
7 Double checking of the maximum character length This query identifies superfluous CHECK constraints where a programmatic length check duplicates a declarative, data type-based length limit. For instance, a CHECK constraint like char_length(column) <= 100 on a column already defined as VARCHAR(100) is redundant. Problem detection INFORMATION_SCHEMA+system catalog base tables 2025-11-13 13:14 MIT License View
8 Find columns that require new lookup tables (based on names and field sizes) This query detects data attributes that function as implicit classifiers but lack a corresponding reference entity. It targets textual columns that are not currently constrained (no PK, UK, or FK) but exhibit characteristics of coded data: they either have a very short length (≤ 3 characters) or possess identifiers typical of classifiers (e.g., 'status', 'type'). To reduce false positives, it excludes obvious free-text fields (names, comments) and verifies that no table with a similar name currently exists. This suggests the need to extract these attributes into a new dedicated reference table to enforce domain integrity. Problem detection INFORMATION_SCHEMA+system catalog base tables 2025-12-30 09:14 MIT License View
9 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 2025-11-27 10:34 MIT License View
10 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
11 Inconsistent field sizes of columns for addresses Find as to whether columns for holding e-mail addresses, phone numbers, ip addresses, zip codes, ordinary addresses, or file addresses have inconsistent field sizes across tables. Problem detection INFORMATION_SCHEMA only 2025-11-07 10:11 MIT License View
12 Inconsistent precision and scale usage in case of registering sums of money Find as to whether different precisions/scales are used in case of registering data about sums of money in different columns. Problem detection INFORMATION_SCHEMA only 2025-11-07 10:11 MIT License View
13 Incorrect field size (based on default values) This query identifies a potential schema mismatch regarding data precision. It flags base table columns that default to CURRENT_USER or SESSION_USER but define a character length differing from the PostgreSQL standard identifier limit (typically 63 bytes, defined by NAMEDATALEN - 1).

Risk (Length < 63): Poses a hard runtime failure risk if a username exceeds the defined length. Inefficiency (Length > 63): Indicates imprecise modeling, as the stored value can technically never exceed the system limit.
Problem detection INFORMATION_SCHEMA only 2025-12-15 11:09 MIT License View
14 Name and description maximum length Find tables where is both a column for registering name and description. Find the permitted maximum field size in these columns. Take into account that the maximum length may be controlled by using a CHECK constraint. Make sure that the permitted maximum field sizes are sufficiently different. General INFORMATION_SCHEMA+system catalog base tables 2025-11-07 10:11 MIT License View
15 Potentially a classifier is missing (based on field sizes) Find columns that are not covered by a primary key, unique, and foreign key constraint but have a textual type with the maximum field size 3 or less. General INFORMATION_SCHEMA+system catalog base tables 2025-11-07 10:11 MIT License View
16 Reference to the numeric type is too imprecise, i.e., precision and scale are missing Find base table columns that have the DECIMAL/NUMERIC type, but do not have precision and scale specified. "Specifying: NUMERIC without any precision or scale creates a column in which numeric values of any precision and scale can be stored, up to the implementation limit on precision. A column of this kind will not coerce input values to any particular scale, whereas numeric columns with a declared scale will coerce input values to that scale." Problem detection INFORMATION_SCHEMA only 2025-11-07 10:11 MIT License View
17 The maximum number of characters may be missing Perhaps the character maximum length has been omitted accidentally, i.e., one wrote VARCHAR instead of VARCHAR(n) where n is the maximum permitted number of characters in the field value. VARCHAR and TEXT are synonyms. Problem detection INFORMATION_SCHEMA only 2025-11-07 10:11 MIT License View
18 Unbounded textual columns for non-descriptive attributes This query identifies base table columns defined as unbounded TEXT or VARCHAR (without a length specifier) that lack any corresponding CHECK constraint to restrict value length. It explicitly excludes foreign key columns and columns heuristically identified as descriptive fields (e.g., names containing "comment", "description", "note"), where arbitrary length is typically acceptable. For structured attributes (such as names, codes, or identifiers), relying on unbounded types without constraints is a design risk, potentially allowing excessive data payload, complicating index usage, and violating domain constraints. Problem detection INFORMATION_SCHEMA+system catalog base tables 2025-11-27 10:19 MIT License View