Re: deleting rows in specific order - Mailing list pgsql-sql

From Daniel Drotos
Subject Re: deleting rows in specific order
Date
Msg-id Pine.LNX.4.61.0610112108100.16984@mazsola.iit.uni-miskolc.hu
Whole thread Raw
In response to Re: deleting rows in specific order  (Markus Schaber <schabi@logix-tt.com>)
Responses Re: deleting rows in specific order
Re: deleting rows in specific order
List pgsql-sql
On Wed, 11 Oct 2006, Markus Schaber wrote:

> What is it that you're trying to achieve with the ordered delete? Maybe
> there's a better way to solve your underlying problem.

I've a table which has a field for some info (number) and a date field 
(insertion date) and others.

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.

Trigger's algorithm is a little bit more dificult which I would be 
able to simplify if rows are deleted in date order.

Now I'm doing it in a plpgsql function using a `for in select loop' to 
delete rows one by one.

Daniel


pgsql-sql by date:

Previous
From: Markus Schaber
Date:
Subject: Re: deleting rows in specific order
Next
From: "Stuart"
Date:
Subject: slow view