Listing Triggers on a table.

Started by Paulover 25 years ago2 messagesgeneral
Jump to latest
#1Paul
paul@operamail.com

How do I go about finding out the names of triggers attached to a table?
Currently I'm doing :
pg_dump <dbname> | grep TRIGGER | grep <tablename>
from the shell command line. Is there a quicker way of doing it in psql?

Paul

#2Dan Wilson
phpPgAdmin@acucore.com
In reply to: Paul (#1)
Re: Listing Triggers on a table.

From the newly added phpPgAdmin source code:

SELECT tgname AS trigger_name, pt.typname as result, pc.relname as
table_name
FROM pg_trigger ptr, pg_type pt, pg_class pc
WHERE ptr.tgtype = pt.oid
AND ptr.tgrelid = pc.oid
AND tgname !~ 'pg_.*'
AND pc.relname = '[insert table name]'
ORDER BY tgname

Get the latest phpPgAdmin at http://www.greatbridge.org/project/phppgadmin

-Dan Wilson

----- Original Message -----
From: "Paul" <paul@operamail.com>
To: <pgsql-general@postgresql.org>
Sent: Sunday, November 26, 2000 8:21 PM
Subject: [GENERAL] Listing Triggers on a table.

Show quoted text

How do I go about finding out the names of triggers attached to a table?
Currently I'm doing :
pg_dump <dbname> | grep TRIGGER | grep <tablename>
from the shell command line. Is there a quicker way of doing it in psql?

Paul