"Nikolay Samokhvalov" <samokhvalov(at)gmail(dot)com> writes:
> Is this a bug or not?
I don't think so --- or perhaps better, this is a buggy trigger.
he UPDATE in the trigger will supersede the base DELETE query for any
rows that the UPDATE changes before the base DELETE has reached 'em.
Essentially you've written an indeterminate system ...
regards, tom lane