Goal | If the name of a routine parameter and the name of a column of a table that is used in the routine are the same, then it makes it more difficult to understand the code. |
Notes | In case of table functions the output parameters are not considered because in case of table functions column names correspond to output parameters. The query uses the information_schema view routine_column_usage that was added to PostgreSQL 14. The view contains only information about routines that are written in SQL language and have the SQL-standard body. There could be multiple routines with the same name but with different parameters in the same schema (overloading). Thus, for the unique identification of the routine it is necessary to present also its parameters in addition to the schema name and routine name. Here is an example of a routine with such a problem: CREATE OR REPLACE FUNCTION public.f_delete_emp(empno IN Emp.empno%TYPE) |
Type | Problem detection (Each row in the result could represent a flaw in the design) |
Reliability | High (Few or no false-positive results) |
License | MIT License |
Data Source | INFORMATION_SCHEMA+system catalog |
SQL Query |
|
This query belongs to the following collections:
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 . |
This query is classified under the following categories:
Name | Description |
---|---|
Comfortability of database evolution | Queries of this category provide information about the means that influence database evolution. |
Does not work in some earlier PostgreSQL version | Queries of this category provide information that was not available in some earlier PostgreSQL version |
Naming | Queries of this category provide information about the style of naming. |
User-defined routines | Queries of this category provide information about the user-defined routines |