Mage, add "raise notice" at the begin of your buggy trigger.
pgsql-general by date:
Соглашаюсь с условиями обработки персональных данных