periods icon indicating copy to clipboard operation
periods copied to clipboard

Allow history table to be partitioned

Open eryx67 opened this issue 5 years ago • 0 comments

Is it possible to allow history table to be partitioned? Function add_system_versioning doesn't allow me to do so, probably here:

https://github.com/xocolatl/periods/blob/d7b2081dd65514bbb8e96d8de4904d9357fa30c9/periods--1.2.sql#L2601

But if I create history table as normal and then substitute its name with name of partitioned table all works fine:

UPDATE periods.system_versioning SET history_table_name = TO_REGCLASS('partitioned_table_hist')
WHERE history_table_name='normal_table_hist'::regclass;

The only problem is management. I have to change all partitioned table names every time I need to add a new history table.

eryx67 avatar Feb 24 '21 21:02 eryx67