Обсуждение: How do I find a trigger function that is raising notices?

Поиск
Список
Период
Сортировка

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

От
Rob Richardson
Дата:
Greetings!

I've got a query that is behaving strangely, but that's not the reason for this question.  The update results in a
triggerbeing 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,
someonetold 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
findout what trigger function raised these messages?
 

Thanks very much!

RobR

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

От
bricklen
Дата:

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>%';

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

От
Rob Richardson
Дата:

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> 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>%';