Re: Column type modification in big tables - Mailing list pgsql-general

From Lok P
Subject Re: Column type modification in big tables
Date
Msg-id CAKna9Vb0ABStAWogCsXK+jTT9ZuLESJ0_-r3Wtvd=rZpYMYwxw@mail.gmail.com
Whole thread Raw
In response to Re: Column type modification in big tables  (sud <suds1434@gmail.com>)
Responses Re: Column type modification in big tables
List pgsql-general

On Sat, Aug 10, 2024 at 5:47 PM sud <suds1434@gmail.com> wrote:


My 2cents. 
If you have enough time then from a simplicity point of view, your single line alter command may look good, but how are you going to see  the amount of progress it has made so far and how much time it's going to take to finish. And you got ~6hrs of down time but if it fails at 5th hour then you will be in a bad position. 


 
Does it mean that , if we get enough downtime then , we should rather go with the option of recreating the table from scratch and populating the data from the existing table and then rename it back? It does look more complicated considering many steps like creating indexes, constraints back and renaming it and then running vacuum and analyze etc. 

Can someone through some light , in case we get 5-6hrs downtime for this change , then what method should we choose for this Alter operation?

pgsql-general by date:

Previous
From: yudhi s
Date:
Subject: Re: Insert works but fails for merge
Next
From: Adrian Klaver
Date:
Subject: Re: Insert works but fails for merge