How can I get Postgres to generate partitions based on a field?

Viewed 25

I have a table with three fields & composite primary key:

  • SensorID, primary
  • Timestamp, primary
  • Value

I want Postgres to partition on SensorID. I do not know ahead of time what the SensorIDs will be. Postgres will need to generate new partitions as new SensorIDs arrive.

Questions:

  • Should I be using a hash or list based partition?
  • Is it possible to achieve this behaviour without using triggers?
0 Answers
Related