Re: List Functions and Code

From: Adrian Klaver <adrian(dot)klaver(at)gmail(dot)com>
To: pgsql-general(at)postgresql(dot)org
Cc: Rebecca Clarke <rebecca(at)clarke(dot)net(dot)nz>
Subject: Re: List Functions and Code
Date: 2011-07-28 13:43:29
Message-ID: 201107280643.29718.adrian.klaver@gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

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(dot)klaver(at)gmail(dot)com

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Pavel Stehule 2011-07-28 13:50:01 Re: List Functions and Code
Previous Message Tom Lane 2011-07-28 13:41:11 Re: issue with pg_restore