Replies: 4 comments 3 replies
-
You either need data in the partition set for partman to make new partitions, or if it is time-based, you can set |
Beta Was this translation helpful? Give feedback.
-
If you expect large gaps in the data insertion rate, you can also set the |
Beta Was this translation helpful? Give feedback.
-
I added the following to the steps originally taken and then ran UPDATE partman.part_config SET retention = '5 hours', retention_keep_table = false, infinite_time_partitions = true WHERE parent_table = 'public.my_table'; So I tried to redo it with minutes and test live what happens. initial run
On subsequent runs, it deleted partitions to match retention. subsequent run
It never creates new tables, and eventually drops all child tables until it has only one old child table left:
|
Beta Was this translation helpful? Give feedback.
-
Hi @keithf4 Ultimately, I just always wanted there to be a fixed number of partitions. For example, 48 partitions, one for each hour of retention regardless if there was data in them. |
Beta Was this translation helpful? Give feedback.
-
I'm planning to run
pg_partman
without the background worker. To prepare for that, I've be just trying to manually create a test table, and then runrun_maintenance()
to ensure that forward-looking partitions are being created. My initial use-case was a bit more complex, so I reduced complexity for testing purposes. However, I can still not get any future partitions to be created.For setup, I'm running this in a container, and this is my Dockerfile:
extension data:
I'm just using the
postgres
user for now to connect to a test database:result
I've tried both
1 hour
and1 minute
intervals for testing. In practice, I'll likely use1 day
intervals. Waiting a while and runningrun_maintenance()
seems to do nothing. The same is true if I delete the last partition and then runrun_maintenance()
. I'm running it this way:The output with
DEBUG1
looks like this:output logs
I've looked at this previous discussion, but while I am running the maintenance manually, its unclear if its saying I literally need to
INSERT
data to trigger new partitions to be created. Is there something I'm missing to trigger the creation of new partitions?Beta Was this translation helpful? Give feedback.
All reactions