Re: Search for text in any function - Mailing list pgsql-general

From hubert depesz lubaczewski
Subject Re: Search for text in any function
Date
Msg-id 20090219181403.GB27755@depesz.com
Whole thread Raw
In response to Search for text in any function  ("Rob Richardson" <Rob.Richardson@rad-con.com>)
Responses Re: Search for text in any function
List pgsql-general
On Thu, Feb 19, 2009 at 12:46:41PM -0500, Rob Richardson wrote:
> Can anyone suggest a query that will tell me the names of all functions
> (both trigger and normal) that contain a given string of text?

assuming you mean pl/* functions, you can simply use:

select proname from pg_proc where prosrc ~* 'string';

another solution might be to use pg_dump, and grep the dump, but select
from pg_proc does it's job.

Best regards,

depesz

--
Linkedin: http://www.linkedin.com/in/depesz  /  blog: http://www.depesz.com/
jid/gtalk: depesz@depesz.com / aim:depeszhdl / skype:depesz_hdl / gg:6749007

pgsql-general by date:

Previous
From: c k
Date:
Subject: Re: UPDATE
Next
From: "Rob Richardson"
Date:
Subject: Re: Search for text in any function