Update data

Update data in a hypertable with a standard UPDATE SQL command.

Update a single row

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.

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

Update multiple rows at once

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:

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