# Solved : Noob question over data management in InfuxDB

**URL:** <https://community.influxdata.com/t/solved-noob-question-over-data-management-in-infuxdb/3981>\
**Category:** Telegraf\
**Tags:** influxdb, time-series\
**Created:** [February 12, 2018, 4:48pm UTC](https://community.influxdata.com/t/solved-noob-question-over-data-management-in-infuxdb/3981 "2018-02-12T16:48:52Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![Peggy](https://sea1.discourse-cdn.com/flex023/user_avatar/community.influxdata.com/peggy/32/1015_2.png) [@Peggy](https://community.influxdata.com/u/Peggy)\
**Post date:** [February 12, 2018, 4:48pm UTC](https://community.influxdata.com/t/solved-noob-question-over-data-management-in-infuxdb/3981/1 "2018-02-12T16:48:52Z")

</div>

Hello,

I’ve been using Influxdb 0.9 together with Domoticz and Grafana for 1 month. I get nice charts, everything would be perfect if I could manage a little bit the data stored in influxdb. Just a basic example : due to a bug in my software, some of my temp have been reporting random temps between 30°C and 100°C during some hours. Well, I’ve spent hours trying to find how to delete them.

This don’t work :

delete FROM blah WHERE time \< ‘2018-02-02’ and time \> ‘2018-02-01’  
–\> error parsing query: retention policy not supported at line 1, char 1

This don’t work :

drop series from blah where time \< ‘2018-02-02’ and time \> ‘2018-02-01’  
–\> error parsing query: retention policy not supported at line 1, char 1

The only way to ‘delete’ I found is to export the database in a file, find the timestamp of the serie to delete, then write a new serie using the same timestamp. I won’t do this for the 300 temps that need to be effectively deleted.

It is worst with tags, I have many test tags I used at the beginning on real data, it looks like it is not possible to update them to the right value.

I hope I missed something, my system is not perfect, I must be able to clean data easily.

Thank you by advance for your help.

 ![](https://discoursecommunity.s3-us-west-1.amazonaws.com/original/2X/3/3a3adc77585ccb0ad19794688d9223833117427d.png)

---

<div class="post-metadata">

**Author:** ![sbains](https://avatars.discourse-cdn.com/v4/letter/s/cdc98d/32.png) [@sbains](https://community.influxdata.com/u/sbains)\
**Post date:** [February 13, 2018, 5:21am UTC](https://community.influxdata.com/t/solved-noob-question-over-data-management-in-infuxdb/3981/2 "2018-02-13T05:21:01Z")

</div>

You can delete it using the either of the following timestamps

1. Time Format RFC3339: ‘2018-02-13T00:02:05Z’
2. Epoch (with s at the end): 1518499082s

sample

delete from cpu where time \> ‘2018-02-08T00:00:00Z’ and time \< '2018-02-08T02:00:00Z’  
delete from cpu where time \> 1518422400s and time \< 1518499082s

---

<div class="post-metadata">

**Author:** ![Peggy](https://sea1.discourse-cdn.com/flex023/user_avatar/community.influxdata.com/peggy/32/1015_2.png) [@Peggy](https://community.influxdata.com/u/Peggy)\
**Post date:** [February 13, 2018, 9:27am UTC](https://community.influxdata.com/t/solved-noob-question-over-data-management-in-infuxdb/3981/3 "2018-02-13T09:27:48Z")

</div>

Thank you for your help.

I get the following error :

error parsing query: retention policy not supported at line 1, char 1

If I use this formula :

drop series from “domoticz”.“autogen”.“device\_exterieur\_temp” where time \> “2018-02-07T05:00:00Z” and time \< “2018-02-08T16:17:00Z”

I get no error, but nothing happens, and data is still here.

If I use this :

select \* from “domoticz”.“autogen”.“device\_salon\_temp” where time \> ‘2018-02-08T14:00:00Z’ and time \< ‘2018-02-08T15:00:00Z’

I get :

invalid operation: time and \*influxql.VarRef are not compatible  
I’ve tried numerous combinations of syntax (no quotes, simple quotes, double, etc.), none worked. I googled before, but it doesn’t work for me :

> [@DROP SERIES not working for some series](https://community.influxdata.com/t/drop-series-not-working-for-some-series/427/9):
>
> I think I’d prefer you fixed the behaviour slight_smile Regarding the documentation, I see you’ve updated DELETE but not DROP SERIES. I think both need to mention this limitation. Can I suggest the following wording for DROP SERIES: DROP SERIES cannot be used to delete a measurement series which contains data points with timestamps in the future. Use DELETE for deleting such measurements. And for DELETE I think you’ve got your wires crossed - there is no command “DELETE SERIES”. So ma…

---

<div class="post-metadata">

**Author:** ![sbains](https://avatars.discourse-cdn.com/v4/letter/s/cdc98d/32.png) [@sbains](https://community.influxdata.com/u/sbains)\
**Post date:** [February 13, 2018, 4:43pm UTC](https://community.influxdata.com/t/solved-noob-question-over-data-management-in-infuxdb/3981/4 "2018-02-13T16:43:26Z")

</div>

Can you try the following

delete from “domoticz.autogen.device\_salon\_temp” where time \> ‘2018-02-08T14:00:00Z’ and time \< ‘2018-02-08T15:00:00Z’

Drop should be use when you are deleting the entire measurement or when “where” clause is not used.

---

<div class="post-metadata">

**Author:** ![Peggy](https://sea1.discourse-cdn.com/flex023/user_avatar/community.influxdata.com/peggy/32/1015_2.png) [@Peggy](https://community.influxdata.com/u/Peggy)\
**Post date:** [February 13, 2018, 6:32pm UTC](https://community.influxdata.com/t/solved-noob-question-over-data-management-in-infuxdb/3981/5 "2018-02-13T18:32:10Z")

</div>

I already tried before, I tried again, fail.  
If I launch your query, I get a syntax error because of the quote. If I correct the quotes, I get a “retention policy not supported” error.

---

<div class="post-metadata">

**Author:** ![sbains](https://avatars.discourse-cdn.com/v4/letter/s/cdc98d/32.png) [@sbains](https://community.influxdata.com/u/sbains)\
**Post date:** [February 14, 2018, 4:18am UTC](https://community.influxdata.com/t/solved-noob-question-over-data-management-in-infuxdb/3981/6 "2018-02-14T04:18:08Z")

</div>

I assume this is the measurement name “device\_salon\_temp” and the database name is “domoticz”. If you are under this database and try the delete command does it work?

delete from device\_salon\_temp where time \> ‘2018-02-08T14:00:00Z’ and time \< ‘2018-02-08T15:00:00Z’

---

<div class="post-metadata">

**Author:** ![Peggy](https://sea1.discourse-cdn.com/flex023/user_avatar/community.influxdata.com/peggy/32/1015_2.png) [@Peggy](https://community.influxdata.com/u/Peggy)\
**Post date:** [February 14, 2018, 8:36pm UTC](https://community.influxdata.com/t/solved-noob-question-over-data-management-in-infuxdb/3981/7 "2018-02-14T20:36:04Z")

</div>

Your query returns a syntax exception.  
I based my query on the following working query taken from the chronograf data explorer :

SELECT mean(“value”) AS “mean\_value” FROM “domoticz”.“autogen”.“device\_SALON\_TEMP” WHERE time \> now() - 1h GROUP BY :interval: FILL(null)

---

<div class="post-metadata">

**Author:** ![sbains](https://avatars.discourse-cdn.com/v4/letter/s/cdc98d/32.png) [@sbains](https://community.influxdata.com/u/sbains)\
**Post date:** [February 14, 2018, 11:04pm UTC](https://community.influxdata.com/t/solved-noob-question-over-data-management-in-infuxdb/3981/8 "2018-02-14T23:04:57Z")

</div>

The syntax error seems to be related to the name mismatch

Incorrect:

delete from device\_salon\_temp where time \> ‘2018-02-08T14:00:00Z’ and time \< ‘2018-02-08T15:00:00Z’

Correct should be:

delete from device\_SALON\_TEMP where time \> ‘2018-02-08T14:00:00Z’ and time \< ‘2018-02-08T15:00:00Z’

You can always check through the command line by using the following command:

show measurements

---

<div class="post-metadata">

**Author:** ![Peggy](https://sea1.discourse-cdn.com/flex023/user_avatar/community.influxdata.com/peggy/32/1015_2.png) [@Peggy](https://community.influxdata.com/u/Peggy)\
**Post date:** [February 15, 2018, 5:22pm UTC](https://community.influxdata.com/t/solved-noob-question-over-data-management-in-infuxdb/3981/9 "2018-02-15T17:22:43Z")

</div>

This query worked. The conclusion is that it can only be triggered from console. Thank you for your patience, really.
