Search by code in Database Functions #44111
Unanswered
Jasper-Nelligan
asked this question in
Feature Requests
Replies: 1 comment 1 reply
-
|
+1 for this! The use case is very practical — renaming a column and needing to audit all functions that reference it is a real pain point, especially as schemas grow larger. A few thoughts on the feature:
In the meantime, a workaround via SQL that achieves the same goal: SELECT
routine_name,
routine_definition
FROM information_schema.routines
WHERE
routine_type = 'FUNCTION'
AND routine_schema = 'public'
AND routine_definition ILIKE '%your_old_column_name%';Or using SELECT
p.proname AS function_name,
pg_get_functiondef(p.oid) AS definition
FROM pg_proc p
JOIN pg_namespace n ON n.oid = p.pronamespace
WHERE
n.nspname = 'public'
AND pg_get_functiondef(p.oid) ILIKE '%your_old_column_name%';Hope this helps unblock you while the feature is being considered! |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Hi! It would be nice if the search bar under Database -> Functions could search by function code, instead of just by function name. Or at least have option to search by function code.
My use case: I changed a column name in my schema, and I need to update all db functions that reference the old column name. Searching by the old column name would help identify which functions need to be updated
Beta Was this translation helpful? Give feedback.
All reactions