Csaba Nagy <nagy@ecircle-ag.com> writes:
> This is interesting... we actually do have a trigger on that table which
> inserts a record in a kind of archive table for each deleted record. I
> actually forgot about this, good that you reminded me :-)
> But then the TRUNCATE worked fine, and the table was actually truncated,
> and I'm sure the trigger didn't kick in at all. Is this something
> unexpected ?
> The trigger itself is a BEFORE DELETE ... FOR EACH ROW trigger, and it's
> not deferred. I've checked the table too where the trigger inserts, and
> it had indeed a few records, but not as many as the original table had.
> That could though come from previous runs...
If it's a BEFORE trigger then the pending-trigger list isn't at issue.
It sounds to me like the trigger function itself is doing something that
leaks a little memory per firing. You could learn more by looking in
the postmaster log: there should be a verbose report of memory context
sizes put there at the time of the "out of memory" error report.
regards, tom lane