How do I find a trigger function that is raising notices?

Started by Rob Richardsonover 12 years ago3 messagesgeneral
Jump to latest
#1Rob Richardson
RDRichardson@rad-con.com

Greetings!

I've got a query that is behaving strangely, but that's not the reason for this question. The update results in a trigger being fired, but I don't know which one. I thought I disabled all of the triggers on the table being updated. So, I wanted to find the trigger function that contains one of the words in the notice message. A long time ago, someone told me I can search for a function containing a given word using this query:

Select * from pg_proc where lower(prosrc) = '%<target_string>%'

But that's not returning any rows. Is there a different table that contains source for trigger functions? How can I find out what trigger function raised these messages?

Thanks very much!

RobR

--
Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general

#2bricklen
bricklen@gmail.com
In reply to: Rob Richardson (#1)
Re: How do I find a trigger function that is raising notices?

On Thu, Sep 26, 2013 at 9:04 AM, Rob Richardson <RDRichardson@rad-con.com>wrote:

Select * from pg_proc where lower(prosrc) = '%<target_string>%'

A slight revision should work:

select distinct proname from pg_proc where prosrc ilike '%<target_string>%';

#3Rob Richardson
RDRichardson@rad-con.com
In reply to: bricklen (#2)
Re: How do I find a trigger function that is raising notices?

Thanks very much. I was searching for a string containing an upper-case letter without remembering that I used lower(). And your suggestion of ilike is much better than like here.

RobR

From: bricklen [mailto:bricklen@gmail.com]
Sent: Thursday, September 26, 2013 12:05 PM
To: Rob Richardson
Cc: pgsql-general
Subject: Re: [GENERAL] How do I find a trigger function that is raising notices?

On Thu, Sep 26, 2013 at 9:04 AM, Rob Richardson <RDRichardson@rad-con.com<mailto:RDRichardson@rad-con.com>> wrote:
Select * from pg_proc where lower(prosrc) = '%<target_string>%'

A slight revision should work:

select distinct proname from pg_proc where prosrc ilike '%<target_string>%';