Replies: 1 comment 4 replies
-
pg_partman currently only supports managing a single partition interval. However, since the time intervals involved are all 1 day or longer, you may still be able to use partman to at least manage new table creation and possibly retention as well. You would just have to maintain the process to re-partition the data older than 2 years separate from partman. Partman only cares about older tables for retention purposes and in version 5.0+, the child table naming pattern is the same for yearly and monthly, so think it would work. That's why I said possibly, You would need to test that. I'd like to have multi-interval support added at some point. Just need the time to investigate it. Or I'd be happy to review any contributions to try and add the feature. |
Beta Was this translation helpful? Give feedback.
-
Hello all! I am converting a table that we previously had partitioned manually (by range) over to using pg_partman, but I'm not sure how to convert this over given the requirements we have. Currently, the way it's manually configured, and required, is that there should be monthly partitions going back 2 years from the current date, yearly partitions up to 3 years before that, and then everything else is archived. For example:
Looking at the docs and some of our much simpler examples, it looks like only one parent_table configuration can be created where an interval and start_partition are specified. Is something like going to have to be a custom maintenance procedure via pg_cron? If so, any sort of guidance is appreciated. Thanks!
Beta Was this translation helpful? Give feedback.
All reactions