summaryrefslogtreecommitdiff
path: root/sql/londiste/functions/londiste.periodic_maintenance.sql
blob: 0b70d09eae3c8dc423eddd6626e6e161dbaf0a1d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
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