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