Subject Re: [firebird-support] Duplicate Trigger Positions
Author Thomas Steinmaurer
Hi Ann,

> Thomas Steinmaurer wrote:
>
>>Might this affect the firing order of system triggers at the same
>>position per event/type on system tables negatively?
>>
>
> There was a problem in InterBase 6 with the relative order of user and
> system triggers, but it was resolved before Firebird 1 was released.
> When a table is being compiled, the triggers are integrated with a query
> like
> select rdb$trigger_blr from rdb$triggers
> where .....<a variety of checks for system triggers>
> order by rdb$trigger_sequence
>
>
> Nobody cares whether the sequence values are unique, but the order of
> duplicates is ill-defined.

What I meant is that there are system triggers with duplicate trigger
position for the same event/type.

select
rdb$relation_name
, rdb$trigger_type
, rdb$trigger_sequence
, count(*)
from
rdb$triggers
where
rdb$system_flag = 1
group by rdb$relation_name, rdb$trigger_type, rdb$trigger_sequence
having count(*) > 1
order by rdb$relation_name


Just curious whether the firing order of system triggers might be
affected not only by the trigger name, but as you've mentioned by other
aspects as well. IMHO, the safe way would be that even system triggers
have a an equal defined firing order.


Regards,
Thomas