Received: from fw.mccons.net (adsl-65-64-105-41.dsl.kscymo.swbell.net [65.64.105.41]) by postgresql.org (8.11.3/8.11.4) with ESMTP id g0U9Dvl29924 for ; Wed, 30 Jan 2002 04:13:58 -0500 (EST) (envelope-from bmccane@mccons.net) Received: (from root@localhost) by fw.mccons.net (8.11.3/8.11.4) id g0U9Dww59698 for pgsql-admin@postgresql.org; Wed, 30 Jan 2002 03:13:58 -0600 (CST) (envelope-from bmccane@mccons.net) Received: from localhost (localhost [127.0.0.1]) by fw.mccons.net (8.11.3/8.11.4av) with ESMTP id g0U9Dqf59690 for ; Wed, 30 Jan 2002 03:13:52 -0600 (CST) (envelope-from bmccane@mccons.net) Date: Wed, 30 Jan 2002 03:13:51 -0600 (CST) From: Brian McCane To: Subject: Listing Triggers In-Reply-To: <20020129180955.B97423-100000@megazone23.bigpanda.com> Message-ID: <20020130025928.O55884-100000@fw.mccons.net> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-Virus-Scanned: by AMaViS perl-11 X-Archive-Number: 200201/258 X-Sequence-Number: 3139 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"