Skip to content

Commit 56e534e

Browse files
committed
Added simple scripts to delete old historical data from postgresql.
1 parent 3c19fb3 commit 56e534e

File tree

2 files changed

+6
-0
lines changed

2 files changed

+6
-0
lines changed

sql/delete_old.sh

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
#!/bin/bash
2+
3+
psql -U postgres -h 127.0.0.1 json_scada < delete_old.sql
4+

sql/delete_old.sql

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
-- DELETE FROM hist WHERE time_tag < (now() - '30 days'::interval);
2+
SELECT drop_chunks('hist', INTERVAL '30 days');

0 commit comments

Comments
 (0)