Re: identifying duplicate RI triggers - Mailing list pgsql-general

From Tom Lane
Subject Re: identifying duplicate RI triggers
Date
Msg-id 27582.1036788587@sss.pgh.pa.us
Whole thread Raw
In response to Re: identifying duplicate RI triggers  (Stephan Szabo <sszabo@megazone23.bigpanda.com>)
List pgsql-general
Stephan Szabo <sszabo@megazone23.bigpanda.com> writes:
> You can't just use those, you also need to look at least at tgfoid.
> There are generally 3 triggers per constraint that IIRC all have
> the same args but different function oids.

I think looking at tgtype would also serve to distinguish the three
triggers associated with an RI constraint.

In 7.3, management of RI triggers is a lot easier because the system
associates the triggers with a pg_constraint entry (pg_constraint is
a new system catalog).  There is a contrib module contrib/adddepend
that tries to reverse-engineer pg_constraint entries from the bare
trigger definitions that you'd get from a dump of an older database.
I'm not sure how bulletproof adddepend is, but it might be worth
looking at to see how it decides to group triggers into a constraint.

I believe also there is trigger-grouping logic in Red Hat's RH Admin
utility (see http://www.redhat.com/software/database/); you could try
that to see what it thinks you have.

            regards, tom lane

pgsql-general by date:

Previous
From: Jean-Luc Lachance
Date:
Subject: Re: Win2K Questions
Next
From: "scott.marlowe"
Date:
Subject: Re: table growing