X-Original-To: pgsql-jdbc-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.144]) by svr1.postgresql.org (Postfix) with ESMTP id A420F52B16 for ; Wed, 13 Jul 2005 05:47:37 -0300 (ADT) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 58868-10 for ; Wed, 13 Jul 2005 08:47:29 +0000 (GMT) Received: from mail.ecircle.de (mail.ecircle.de [195.140.186.200]) by svr1.postgresql.org (Postfix) with ESMTP id C950452862 for ; Wed, 13 Jul 2005 05:47:27 -0300 (ADT) Received: from [192.168.1.110] (unknown [192.168.1.110]) by mail.ecircle.de (READY) with ESMTP id C53E211D95D; Wed, 13 Jul 2005 10:47:26 +0200 (CEST) Subject: Re: out of memory error on a delete command From: Csaba Nagy To: Kris Jurka Cc: Postgres JDBC In-Reply-To: References: <1121165003.3085.165.camel@coppola.muc.ecircle.de> Content-Type: text/plain Message-Id: <1121244446.3085.183.camel@coppola.muc.ecircle.de> Mime-Version: 1.0 X-Mailer: Ximian Evolution 1.4.6 (1.4.6-2) Date: Wed, 13 Jul 2005 10:47:26 +0200 Content-Transfer-Encoding: 7bit X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0.016 tagged_above=0 required=5 tests=AWL X-Spam-Level: X-Archive-Number: 200507/57 X-Sequence-Number: 13205 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... Thanks, Csaba. On Tue, 2005-07-12 at 21:53, Kris Jurka wrote: > On Tue, 12 Jul 2005, Csaba Nagy wrote: > > > I wonder what could cause such an exception (see below). I was executing > > a "DELETE FROM table_name" command on a table with a lot of records (~ > > 80 million). Now after the fact I realize I should have tried it in psql > > too to see if it fails there too, but I truncated the tables in the > > meantime via "TRUNCATE". The only reason I tried to do it via delete is > > to see how many rows were deleted, but it looks like a bad idea... > > > > org.postgresql.util.PSQLException: ERROR: out of memory > > This is a backend error message so the fact that you issued the command > using JDBC is not relevent and it would have failed from psql as well. > My immediate suspicion was the deferred trigger queue being unable to hold > an event for each row deleted, but any ON DELETE triggers should have > prevented TRUNCATE from running. In any case something on the backend > side is probably using up some memory for each row being deleted. > > Kris Jurka >