| Goal | This query identifies SECURITY DEFINER routines defined with a SQL-standard body (introduced in PostgreSQL 14) that explicitly specify a search_path. While setting the search_path is critical for securing older routine types, it is technically redundant for SQL-standard bodies because they securely resolve objects at parse time. Nevertheless, developers might intentionally configure the path to maintain code consistency and improve readability across the database schema. |
|---|---|
| Type | General Overview of some aspect of the database. |
| License | MIT (opens in new tab) |
| Data Source | INFORMATION_SCHEMA+system catalog |
| SQL Query |
|
Fixing Suggestion
Since this configuration does not pose a security risk or functional error, no immediate corrective action is strictly required. However, you should align these routines with your project's coding standards. You can either remove the redundant search_path configurations to keep the SQL-standard definitions minimal, or consciously retain them to maintain uniform documentation and visual consistency across all routines.
Categories
This query is classified under the following categories:
Security
Queries of this category provide information about the security measures.
User-defined routines
Queries of this category provide information about the user-defined routines
| Name | Description |
|---|---|
| Security | Queries of this category provide information about the security measures. |
| User-defined routines | Queries of this category provide information about the user-defined routines |