This is not failure, this is a query that found zero matching records.
Ie
SELECT sensor_id, MAX(ts), date_trunc('day', ts), COALESCE(MAX(value), 'NaN')::float FROM sensor_values_days WHERE ts > '2017-10-06 00:01:01+00' AND ts < '2017-10-06 23:59:59+00' GROUP BY 1, 3 ORDER BY 1, 2; sensor_id | max | date_trunc | coalesce -----------+-----+------------+---------- (0 rows)
If I remove the timezone part of the start date I get results.