Erik Thiele <erik@thiele-hydraulik.de> writes:
> now. what i wanted to do is ensure that this is done correctly and
> otherwise abort the transaction.
> of course this check needs to be done at the commit time, because if i
> do it on statement level, it cannot work, since i cannot change two
> tables at the same time.
I believe "deferred AFTER" triggers are fired just before commit.
regards, tom lane