Re: out of memory error on a delete command

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Csaba Nagy <nagy(at)ecircle-ag(dot)com>
Cc: Kris Jurka <books(at)ejurka(dot)com>, Postgres JDBC <pgsql-jdbc(at)postgresql(dot)org>
Subject: Re: out of memory error on a delete command
Date: 2005-07-13 13:50:29
Message-ID: 27576.1121262629@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-jdbc

Csaba Nagy <nagy(at)ecircle-ag(dot)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

In response to

Browse pgsql-jdbc by date

  From Date Subject
Next Message Kris Jurka 2005-07-13 15:22:18 Re: patch to fix jdk 2 compile errors and v2 compatability
Previous Message Csaba Nagy 2005-07-13 12:50:03 Re: out of memory error on a delete command