Advertisement
Guest User

delete

a guest
May 26th, 2015
280
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
SQL 0.84 KB | None | 0 0
  1. DELETE FROM alerts WHERE age(to_timestamp(alerts.clock)) > INTERVAL '7 days';
  2. DELETE FROM acknowledges WHERE age(to_timestamp(acknowledges.clock)) > INTERVAL '7 days';
  3. DELETE FROM events WHERE age(to_timestamp(events.clock)) > INTERVAL '7 days';
  4. DELETE FROM history WHERE age(to_timestamp(history.clock)) > INTERVAL '7 days';
  5. DELETE FROM history_uint WHERE age(to_timestamp(history_uint.clock)) > INTERVAL '7 days';
  6. DELETE FROM history_str  WHERE age(to_timestamp(history_str.clock)) > INTERVAL '7 days';
  7. DELETE FROM history_text WHERE age(to_timestamp(history_text.clock)) > INTERVAL '7 days';
  8. DELETE FROM history_log WHERE age(to_timestamp(history_log.clock)) > INTERVAL '7 days';
  9. DELETE FROM trends WHERE age(to_timestamp(trends.clock)) > INTERVAL '90 days';
  10. DELETE FROM trends_uint WHERE age(to_timestamp(trends_uint.clock)) > INTERVAL '90 days'
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement