CREATE TABLE sensor_data ( id SERIAL, sensor_id INT, reading DOUBLE PRECISION, time TIMESTAMPTZ NOT NULL, PRIMARY KEY (id, time) ); SELECT create_hypertable('sensor_data', 'time', chunk_time_interval => INTERVAL '7 days'); INSERT INTO sensor_data (sensor_id, reading, time) VALUES (...