Received: from localhost (wm.hub.org [200.46.204.128]) by postgresql.org (Postfix) with ESMTP id 75B8B9FB22C for ; Mon, 16 Oct 2006 14:40:04 -0300 (ADT) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.128]) (amavisd-new, port 10024) with ESMTP id 95105-03 for ; Mon, 16 Oct 2006 17:39:59 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey- Received: from wolff.to (wolff.to [66.93.197.194]) by postgresql.org (Postfix) with SMTP id 730139FA6B3 for ; Mon, 16 Oct 2006 14:39:59 -0300 (ADT) Received: (qmail 17480 invoked by uid 500); 16 Oct 2006 17:51:10 -0000 Date: Mon, 16 Oct 2006 12:51:10 -0500 From: Bruno Wolff III To: Daniel Drotos Cc: pgsql-sql@postgresql.org Subject: Re: deleting rows in specific order Message-ID: <20061016175110.GA15534@wolff.to> Mail-Followup-To: Bruno Wolff III , Daniel Drotos , pgsql-sql@postgresql.org References: <452CE81A.5010001@logix-tt.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.4.2.1i X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=0 tagged_above=0 required=5 tests= X-Spam-Level: X-Archive-Number: 200610/154 X-Sequence-Number: 26543 On Wed, Oct 11, 2006 at 21:31:37 +0200, Daniel Drotos wrote: > On Wed, 11 Oct 2006, Markus Schaber wrote: > > After inserting new rows into this table, very old rows are going to > be deleted. But value of deleted info should be remembered somehow, so > there is a trigger on delete which keeps sum of the deleted info > values in a separate table. This makes the application happy. You need to be careful if two of these can run at the same time if you are adding the values to prexisting sums otherwise you might end up summing just the values from one of the delete sets.