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

From: Jeff Janes <jeff(dot)janes(at)gmail(dot)com>
To: Wells Oliver <wellsoliver(at)gmail(dot)com>
Cc: "pgsql-general(at)postgresql(dot)org" <pgsql-general(at)postgresql(dot)org>
Subject: Re: Grep'ing for a string in all functions in a schema?
Date: 2014-01-30 21:51:49
Message-ID: CAMkU=1zUHaSobkGUE_25WLK-hoB-crGN2cmH2xnckrTO=kF7aw@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Thu, Jan 30, 2014 at 12:45 PM, Wells Oliver <wellsoliver(at)gmail(dot)com>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?
>
> Clearly if you had all of your functions in a nice VCS you could do this
> but alas I don't yet live in that perfect world.
>

In this imperfect world, I usually just "pg_dump -s -n foo" to a file, then
use grep, vi, etc. on that file.

Cheers,

Jeff

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Tim Uckun 2014-01-30 22:12:13 Database snapshots or clones for staging and testing.
Previous Message Wells Oliver 2014-01-30 20:54:34 Re: Grep'ing for a string in all functions in a schema?