Skip to content

Time interval based retention for ID partitioned table #409

Answered by keithf4
neetam15 asked this question in Q&A
Discussion options

You must be logged in to vote

Directly built into pg_partman, there currently is no way to do this since retention is solely based on the partition column and its data type.

I do have plans to see about allowing multi-column partitioning in the future, which may allow this easier. But that is going to wait until I see the results of this discussion around trigger-based partitioning ( #360 ). It will be much easier to refactor the code if I don't have to worry about supporting the old methods anymore.

You can however manage this yourself by setting up a process that scans for the min-max values in each table based on your created_date column and drops the tables accordingly based on the result.

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@neetam15
Comment options

Answer selected by neetam15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants