summaryrefslogtreecommitdiff
path: root/sql/londiste/functions/londiste.periodic_maintenance.sql
diff options
context:
space:
mode:
Diffstat (limited to 'sql/londiste/functions/londiste.periodic_maintenance.sql')
-rw-r--r--sql/londiste/functions/londiste.periodic_maintenance.sql18
1 files changed, 18 insertions, 0 deletions
diff --git a/sql/londiste/functions/londiste.periodic_maintenance.sql b/sql/londiste/functions/londiste.periodic_maintenance.sql
new file mode 100644
index 00000000..0b70d09e
--- /dev/null
+++ b/sql/londiste/functions/londiste.periodic_maintenance.sql
@@ -0,0 +1,18 @@
+
+create or replace function londiste.periodic_maintenance()
+returns integer as $$
+-- ----------------------------------------------------------------------
+-- Function: londiste.periodic_maintenance(0)
+--
+-- Clean random stuff.
+-- ----------------------------------------------------------------------
+begin
+
+ -- clean old EXECUTE entries
+ delete from londiste.applied_execute
+ where execute_time < now() - '3 months'::interval;
+
+ return 0;
+end;
+$$ language plpgsql; -- need admin access
+