pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Stephan Szabo <sszabo@megazone23.bigpanda.com>
To: Urs Steiner <postgresql@darkstone.ch>
Cc: pgsql-sql@postgresql.org
Subject: Re: list triggers ?
Date: Mon, 21 Jan 2002 10:06:00 -0800 (PST)
Message-ID: <20020121100326.I95108-100000@megazone23.bigpanda.com> (raw)
In-Reply-To: <0ab201c1a25a$6def9a20$ecb88481@ethz.ch>

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.




view thread (4+ messages)  latest in thread

Message-ID: <20020121100326.I95108-100000@megazone23.bigpanda.com>
Permalink:  ../20020121100326.I95108-100000@megazone23.bigpanda.com/
Also on:    postgresql.org/message-id/20020121100326.I95108-100000@megazone23.bigpanda.com

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-sql@postgresql.org
  Cc: sszabo@megazone23.bigpanda.com, postgresql@darkstone.ch
  Subject: Re: list triggers ?
  In-Reply-To: <20020121100326.I95108-100000@megazone23.bigpanda.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox