Re: Grep'ing for a string in all functions in a schema?

Поиск
Список
Период
Сортировка
От hubert depesz lubaczewski
Тема Re: Grep'ing for a string in all functions in a schema?
Дата
Msg-id 20140131123712.GA21358@depesz.com
обсуждение исходный текст
Ответ на Re: Grep'ing for a string in all functions in a schema?  (bricklen <bricklen@gmail.com>)
Список pgsql-general
On Thu, Jan 30, 2014 at 12:52:35PM -0800, bricklen wrote:
> > Since Postgres does not consider a table as a dependency of a function if
> > that table is referenced in the function (probably a good reason), I often
> > find myself in a position of asking "is this table/sequence/index
> > referenced in any of these N number of functions?"
> >
> > Is there an easy way of essentially grep'ing all of the functions in a
> > given schema for a string?
> A method I've used in the past is to create a view of function source which
> can then be searched.

Why not simply:

select p.oid::regproc from pg_proc p join pg_namespace n on p.pronamespace = n.oid where n.nspname = 'your-schema' and
p.prosrc~ 'searched-string'; 

depesz

Вложения

В списке pgsql-general по дате отправления:

Предыдущее
От: mephysto
Дата:
Сообщение: Re: Temporary table already exists
Следующее
От: Albe Laurenz
Дата:
Сообщение: Re: Temporary table already exists