When refactoring PostgreSql functions (and more specific: while searching for 'unused' functions) it would be handy to have a function available to search for a specific string within the function definitions.
Does anyone know if this is the best approach (trying to 'grep'-search the function definitions) or are there alternative methods available?
How would one implement this functionality?
SELECT
proname AS functionname,
prosrc AS source
FROM
pg_proc
WHERE
prosrc ~* 'your_string';
Details about how to use a regex in PostgreSQL, can be found in the manual.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With