From e9c7e761b49bcde12e1719c6644cb810cbbf1722 Mon Sep 17 00:00:00 2001 From: Thomas Berezansky Date: Mon, 18 Jun 2012 13:19:18 -0400 Subject: [PATCH] Purge Circulations: Remove extra delete loop A trigger on action.circulation purges upwards through the circ chain. Thus we don't need to do the loop ourselves. Signed-off-by: Thomas Berezansky Signed-off-by: Jason Stephenson --- Open-ILS/src/sql/Pg/090.schema.action.sql | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/Open-ILS/src/sql/Pg/090.schema.action.sql b/Open-ILS/src/sql/Pg/090.schema.action.sql index 573b1e73af..60d03744cd 100644 --- a/Open-ILS/src/sql/Pg/090.schema.action.sql +++ b/Open-ILS/src/sql/Pg/090.schema.action.sql @@ -1057,11 +1057,8 @@ BEGIN CONTINUE WHEN AGE(NOW(), last_finished) < keep_age; -- We've passed the purging tests, purge the circ chain starting at the end + -- A trigger should auto-purge the rest of the chain. DELETE FROM action.circulation WHERE id = circ_chain_tail.id; - WHILE circ_chain_tail.parent_circ IS NOT NULL LOOP - SELECT * INTO circ_chain_tail FROM action.circulation WHERE id = circ_chain_tail.parent_circ; - DELETE FROM action.circulation WHERE id = circ_chain_tail.id; - END LOOP; count_purged := count_purged + 1; -- 2.43.2