I have a newbie question: It’s possible to have two or more devices generate data points at the same instant, so how can I avoid the unique constraint violation on the hyper table? The incoming data points have a unique id but they’ll sometime have a matching timestamp and this will be an issue when using the same hypertable.
Thanks,
Matt
Hello Matthew! Thanks for the well-worded question. There is no particular requirement that there be a unique timestamp. In fact, the example that is posted to make your first hypertable shows a single transaction that creates 3 rows with identical timestamps.
INSERT INTO conditions
VALUES
(NOW(), 'office', 70.0),
(NOW(), 'basement', 66.5),
(NOW(), 'garage', 77.0);
INSERT 0 3
SELECT * FROM conditions ;
time | location | temperature
------------------------------+----------+-------------
2022-10-11 10:18:25.41698+00 | office | 70
2022-10-11 10:18:25.41698+00 | basement | 66.5
2022-10-11 10:18:25.41698+00 | garage | 77