Received: from megazone.bigpanda.com (megazone.bigpanda.com [63.150.15.178]) by postgresql.org (8.11.3/8.11.4) with ESMTP id g0LJvKl15092 for ; Mon, 21 Jan 2002 14:57:20 -0500 (EST) (envelope-from sszabo@megazone23.bigpanda.com) Received: by megazone.bigpanda.com (Postfix, from userid 1001) id 197A2D5E5; Mon, 21 Jan 2002 10:06:00 -0800 (PST) Received: from localhost (localhost [127.0.0.1]) by megazone.bigpanda.com (Postfix) with ESMTP id 0F2D35BF4; Mon, 21 Jan 2002 10:06:00 -0800 (PST) Date: Mon, 21 Jan 2002 10:06:00 -0800 (PST) From: Stephan Szabo To: Urs Steiner Cc: Subject: Re: list triggers ? In-Reply-To: <0ab201c1a25a$6def9a20$ecb88481@ethz.ch> Message-ID: <20020121100326.I95108-100000@megazone23.bigpanda.com> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-Archive-Number: 200201/247 X-Sequence-Number: 6331 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.