How to use transaction in a trigger ? It seems there is no possibility to control transaction within function
You cannot. You don't get to introduce a transaction boundary in the middle of a statement's execution. Not to mention what it would mean to have transaction boundaries for deferred triggers.
Чтобы сделать работу с сайтом удобнее, мы используем cookie и аналитический сервис «Яндекс.Метрика». Продолжая пользоваться сайтом, вы соглашаетесь с их использованием.