Searching through trigger functions

Started by Bob Pawleyover 14 years ago3 messagesgeneral
Jump to latest
#1Bob Pawley
rjpawley@shaw.ca

Hi

I have an error somewhere in one of the trigger functions in my database. The error message only told me it was a ‘Select * From (table name).

Is there a global method of finding where this expression resides other than searching each script individually.

Bob

#2Merlin Moncure
mmoncure@gmail.com
In reply to: Bob Pawley (#1)
Re: Searching through trigger functions

On Mon, Sep 26, 2011 at 12:47 PM, Bob Pawley <rjpawley@shaw.ca> wrote:

Hi

I have an error somewhere in one of the trigger functions in my database.
The error message only told me it was a ‘Select * From (table name).

Is there a global method of finding where this expression resides other than
searching each script individually.

all function bodies are in pg_proc.prosrc. search that...

merlin

#3Alan Hodgson
ahodgson@simkin.ca
In reply to: Bob Pawley (#1)
Re: Searching through trigger functions

On September 26, 2011 10:47:20 AM Bob Pawley wrote:

Hi

I have an error somewhere in one of the trigger functions in my database.
The error message only told me it was a ‘Select * From (table name).

Is there a global method of finding where this expression resides other
than searching each script individually.

pg_dump -s > file; vi file; /s search_string

Alternately, I find it good practice to maintain function definitions outside of
the database, under version control. You can then grep those files as needed.