Disclosure: I build Schemity , a desktop ERD tool - this post is from our blog and uses it for the examples.
TL;DR: A hypertable can reference a plain table, a plain table can reference a hypertable, and a hypertable cannot reference a hypertable, itself included. The middle case is the trap: the key is accepted, and then drop_chunks and the retention policy refuse to drop chunks, even when no row points into them. Point the key at the plain entity table, such as devices , and keep the reading time as an ordinary column.
A TimescaleDB hypertable can reference a plain table, and a plain table can reference a hypertable, but only the first direction works with a retention policy.…