Re: list triggers ? - Mailing list pgsql-sql

From Stephan Szabo
Subject Re: list triggers ?
Date
Msg-id 20020121100326.I95108-100000@megazone23.bigpanda.com
Whole thread Raw
In response to list triggers ?  ("Urs Steiner" <postgresql@darkstone.ch>)
List pgsql-sql
On Mon, 21 Jan 2002, Urs Steiner wrote:

> part of the output of this command was:
>
> NOTICE:  CREATE TABLE will create implicit trigger(s) for FOREIGN KEY
> check(s)
> CREATE
>
> now, the creation is actually OK. But how do i find out which triggers
> exist and what they look like ? (generically, in this case i assume it
> to be some default, available fropm the docu)

It depends on what you want to see.

select * from pg_trigger; will give you a list of the triggers.  You'd
need to join it with pg_class and pg_proc to get the table name and
function name being called. Something like:select relname, tgname, tgtype, proname, prosrc, tgisconstraint,
tgconstrname, tgconstrrelid, tgdeferrable, tginitdeferred, tgnargs,
tgattr, tgargs from (pg_trigger join pg_class on tgrelid=pg_class.oid)
join pg_proc on (tgfoid=pg_proc.oid);

If you want to see what the triggers are doing, in the case of the foreign
key ones the code's in C in src/backend/utils/adt/ri_triggers.c I
believe.



pgsql-sql by date:

Previous
From: Marius Andreiana
Date:
Subject: support for transact-sql?
Next
From: Stephan Szabo
Date:
Subject: Re: support for transact-sql?