| Goal | This query audits the schema for semantic ambiguity by identifying pairs of routine names (functions, procedures) that exhibit high textual similarity but are not identical. It filters for name pairs with a Levenshtein edit distance of exactly one (less than two, but excluding equality). This specific filter targets typographical errors (e.g., calc_tax vs. calc_tux) or inconsistent singular/plural naming (e.g., get_user vs. get_users), while correctly ignoring valid method overloading where names are identical. |
|---|---|
| Notes | The query uses a function from the fuzzystrmatch extension. The query does not consider routines of extensions because PostgreSQL supports overloading of routines. |
| Type | Problem detection (Each row in the result could represent a flaw in the design) |
| Reliability | Medium (Medium number of false-positive results) |
| License | MIT (opens in new tab) |
| Fixing Suggestion | Make sure that the names are correct and there are no duplication or unused routines. |
| Data Source | INFORMATION_SCHEMA+system catalog |
| SQL Query |
|
Collections
This query belongs to the following collections:
Find problems automatically
Queries, that results point to problems in the database. Each query in the collection produces an initial assessment. However, a human reviewer has the final say as to whether there is a problem or not .
| Name | Description |
|---|---|
| Find problems automatically | Queries, that results point to problems in the database. Each query in the collection produces an initial assessment. However, a human reviewer has the final say as to whether there is a problem or not . |
Categories
This query is classified under the following categories:
Duplication of implementation elements
Queries of this catergory provide information about the duplication of the database objects.
Naming
Queries of this category provide information about the style of naming.
Overloading
Queries of this category provide information about overloading of routines.
Unused implementation elements
Queries of this catergory provide information about the database objects that are not used.
User-defined routines
Queries of this category provide information about the user-defined routines
| Name | Description |
|---|---|
| Duplication of implementation elements | Queries of this catergory provide information about the duplication of the database objects. |
| Naming | Queries of this category provide information about the style of naming. |
| Overloading | Queries of this category provide information about overloading of routines. |
| Unused implementation elements | Queries of this catergory provide information about the database objects that are not used. |
| User-defined routines | Queries of this category provide information about the user-defined routines |