Stef,
> I am trying to write a function/Trigger in pl/perl (although any
> other language which allows this is perfectly fine with me :) and I need to
> find the firing statement. I understand that if the trigger was fired in
> a long sequence, then of course, the calling statement will be the
> previous trigger.
Talk to David Fetter (author of DBI-Link) about this. You're also probably
unnecessarily replicating his work.
It's not currently possible, unfortunately. Tge real way to do this would be
through RULES. However, RULEs currently don't give you a handle on query
substructures like where clauses (let alone join clauses). DF and I have
talked about it, but it would take some major back-end hacking to enable
it. :-(
--
Josh Berkus
Aglio Database Solutions
San Francisco