Re: Search for text in any function

From: hubert depesz lubaczewski <depesz(at)depesz(dot)com>
To: Rob Richardson <Rob(dot)Richardson(at)rad-con(dot)com>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: Search for text in any function
Date: 2009-02-19 18:14:03
Message-ID: 20090219181403.GB27755@depesz.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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(at)depesz(dot)com / aim:depeszhdl / skype:depesz_hdl / gg:6749007

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Rob Richardson 2009-02-19 18:27:23 Re: Search for text in any function
Previous Message c k 2009-02-19 18:08:00 Re: UPDATE