I have to design a wide table for a database (timescaleDB, which will create hypertables based on date), but it seems like there are no possible primary keys, even if we are talking about composite keys.
| id | attribute1 | attribute2 | attribute3 | attribute4 | date_time
| ---| ---------- | ---------- | ---------- | ---------- | -------------------
| P1 | A | 20 | NULL | NULL | 2021-01-01 00:00:00
| P1 | B | 10 | NULL | NULL | 2021-01-01 00:00:00
| P1 | NULL | NULL | 200 | 300 | 2021-01-01 00:00:00
| P2 | C | 25 | NULL | NULL | 2021-01-01 00:00:00
| P2 | NULL | NULL | 150 | 400 | 2021-01-01 00:00:00
The problem is that we are scraping data that is describing P1, P2, etc. as a whole, and also that is describing only a part of P1 (A and B are part of P1) P2 (C), etc...
Is there any way to make this work without splitting up the table?