Re: out of memory error on a delete command - Mailing list pgsql-jdbc

From Tom Lane
Subject Re: out of memory error on a delete command
Date
Msg-id 27576.1121262629@sss.pgh.pa.us
Whole thread Raw
In response to Re: out of memory error on a delete command  (Csaba Nagy <nagy@ecircle-ag.com>)
List pgsql-jdbc
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

pgsql-jdbc by date:

Previous
From: Csaba Nagy
Date:
Subject: Re: out of memory error on a delete command
Next
From: Kris Jurka
Date:
Subject: Re: patch to fix jdk 2 compile errors and v2 compatability