Using PostgreSQL with pgAdmin, and was wondering if there is a way to search ALL of the functions of a database for a particular text.
Is this possible?
Using PostgreSQL with pgAdmin, and was wondering if there is a way to search ALL of the functions of a database for a particular text.
Is this possible?
Something like this should work:
select proname, prosrc from pg_proc where prosrc like '%search text%';
see How to display the function, procedure, triggers source code in postgresql?
If schema info is required too (we work with many):
select
nspname,
proname,
prosrc
from pg_catalog.pg_proc pr
join pg_catalog.pg_namespace ns on ns.oid = pr.pronamespace
where prosrc ilike '%search text%'
Answers posted by @Andreas and @steevee didn't work out for me, so I had to do the following way:
\x
\df+
to list down all stored procedures (in less mode by enabling extended display above) then press /
key to search for a keyword.