Open anjay-gupta opened 3 weeks ago
So just to be clear, did calling the run_maintance()
functions explicitly on the given tables work as you expected then?
If so, then version 5.1 of pg_partman should have a solution for you. It added a maintenance_order
column to the part_config
table. With it, you can explicitly set which order each partition set will run in. So in your case here, just make sure the tables with the FK relations are set to run in the order that works for them.
Any partition sets without maintenance_order
set will run after all other ordered partitions.
https://github.com/pgpartman/pg_partman/blob/master/CHANGELOG.md#510 https://github.com/pgpartman/pg_partman/blob/master/doc/pg_partman.md#configuration-tables
@mattp PG Version : 16 Partman Version : 5.0.1
I have two partitioned tables, booking and booking_lines, with the following setup:
booking is partitioned by created_at on a monthly basis. booking_lines references booking via a foreign key (booking_id) and is also partitioned by created_at. Both tables have an archive retention policy configured to move partitions older than 6 months to an archive schema (cbk_archive)
Post execution , i can see the "cbk.booking_lines" moved to but not able to move the "cbk.bookings" to archive. Please suggest the bug fix or any alternative maintainable solution. we have many tables 1:m and m:m relations and we are trying to manage the 6 month of transactional data and rest moved to archive schema.