On Thursday, July 28, 2011 6:31:32 am Rebecca Clarke wrote: > Hi > > I want to search and list all the functions in a database that reference a > particular table within its code. Is there a way to do this? > > I can list all the functions from pg_proc, however there is nothing there > which provides the code of the function, so therefore I can't query if it > mentions a table. I've tried looking in information_schema.routines but > this unfortunately does not have it either. > > Rebecca http://www.postgresql.org/docs/9.0/interactive/catalog-pg-proc.html prosrc in pg_proc should, with the following caveat from the docs: "For compiled functions, both built-in and dynamically loaded, prosrc contains the function's C-language name (link symbol). For all other currently-known language types, prosrc contains the function's source text. probin is unused except for dynamically-loaded C functions, for which it gives the name of the shared library file containing the function. " -- Adrian Klaver adrian.klaver@xxxxxxxxx |