Skip to content

Update data

Update single and multiple rows in a hypertable in your TimescaleDB database with SQL

Point fixes and time-bounded corrections both use UPDATE against a hypertable, just like a regular table.

Update a single row with the syntax UPDATE ... SET ... WHERE. For example, to update a row in the conditions hypertable with new temperature and humidity values, run the following. The WHERE clause specifies the row to be updated.

UPDATE conditions
SET temperature = 70.2, humidity = 50.0
WHERE time = '2017-07-28 11:42:42.846621+00'
AND location = 'office';

You can also update multiple rows at once, by using a WHERE clause that filters for more than one row. For example, run the following to update all temperature values within the given 10-minute span:

UPDATE conditions
SET temperature = temperature + 0.1
WHERE time >= '2017-07-28 11:40'
AND time < '2017-07-28 11:50';