Frank van Vugt <ftm(dot)van(dot)vugt(at)foxi(dot)nl> writes:
>> Those are bugs (although there is probably only one bug and the rest is
>> collateral damage). May we have a test case?
> Scripts, triggers and stuff are a bit complex, before assigning the resources
> for that, could we help with creating a backtrace?
You did show a backtrace --- it proves only what was already obvious,
namely that the problem is in transaction cleanup.
regards, tom lane