Re: Partition boundary messed up - Mailing list pgsql-general

From Lok P
Subject Re: Partition boundary messed up
Date
Msg-id CAKna9VbvovPsOibzPVNxw88vP+=fCZpQ8A=Vvacpw4=8+-X6mQ@mail.gmail.com
Whole thread Raw
In response to Re: Partition boundary messed up  (yudhi s <learnerdatabase99@gmail.com>)
List pgsql-general
Thank you. I understand that is going to take a lot of time as we already have billions of rows in the main table spread across 40+ partitions. 
Also this table is child to another parent partition table and so,  it will take a lot of time to validate the FK constraint back for the new table.
Is there a less disruptive way(zero to minimal downtime) possible to fix this mess?

On Sat, Jul 27, 2024 at 2:08 PM yudhi s <learnerdatabase99@gmail.com> wrote:
If you were thinking of some ALTER command which will just alter the boundaries of the incorrect partition and make it correct ,  I don't think there exists any such. You may have to create a whole new table and run the partman.create_parent block with the UTC time zone set so that all the subsequent partitions will be created with correct boundaries and then move the data into it from the existing table.

 

pgsql-general by date:

Previous
From: yudhi s
Date:
Subject: Re: Partition boundary messed up
Next
From: Durgamahesh Manne
Date:
Subject: Scheduling pg_repack job with pg_cron