PostgreSQL: get latest row for each time interval
I have the following table. It is stored as a TimescaleDB hypertable. Data rate is 1 row per second. CREATE TABLE electricity_data ( "time" timestamptz NOT NULL, meter_id integer REFERENCES meters NOT NULL, import_low double precision, import_normal double precision, export_low…