Listing Triggers - Mailing list pgsql-admin

From Brian McCane
Subject Listing Triggers
Date
Msg-id 20020130025928.O55884-100000@fw.mccons.net
Whole thread Raw
In response to Re: SQL Script  (Stephan Szabo <sszabo@megazone23.bigpanda.com>)
Responses Re: Listing Triggers  (Tom Lane <tgl@sss.pgh.pa.us>)
Re: Listing Triggers  ("Arguile" <arguile@lucentstudios.com>)
List pgsql-admin
Greetings,

    I am sure I have seen this, but I have searched the docs, and
tried to search the archives, which was a definite exercise in futility.
How can I list the triggers on a specific table?  I tried the following:

=> select * from pg_trigger where tgargs like '%foo%' ;
ERROR:  Unable to identify an operator '~~' for types 'bytea' and 'unknown'
        You will have to retype this query using an explicit cast

The reason I ask is because I had a problem the other day.  I dropped a
table and the triggers didn't get deleted.  I couldn't do anything with
the other table the trigger was on because all of my constraints failed.
I had to go in and manually find and delete the triggers, which was not an
easy task.  Finding a couple needles out of 500+ triggers with no good
tools to help me was not fun.  HINT: I dumped pg_trigger with oid's to a
file, found the triggers using grep, and then deleted them by oid.

- brian

Wm. Brian McCane                    | Life is full of doors that won't open
Search http://recall.maxbaud.net/   | when you knock, equally spaced amid those
Usenet http://freenews.maxbaud.net/ | that open when you don't want them to.
Auction http://www.sellit-here.com/ | - Roger Zelazny "Blood of Amber"


pgsql-admin by date:

Previous
From: "Martins Zarins"
Date:
Subject: tags in HTML formated output
Next
From: Ferdinand Smit
Date:
Subject: Re: INSERT performace.