Re: Column type modification in big tables
Greg Sabino Mullane <htamfids@gmail.com>
From: Greg Sabino Mullane <htamfids@gmail.com>
To: Lok P <loknath.73@gmail.com>
Cc: Alban Hertroys <haramrae@gmail.com>, sud <suds1434@gmail.com>, pgsql-general <pgsql-general@lists.postgresql.org>
Date: 2024-08-17T15:55:56Z
Lists: pgsql-general
On Thu, Aug 15, 2024 at 4:41 PM Lok P <loknath.73@gmail.com> wrote: > Additionally , if we are okay with the 7.5hrs of down time , is my > calculation/extrapolation of total time consumption based on a sample > table, for direct alter, accurate? Because, in that case , I was thinking > it's less complex and also less error prone to just do it in a single alter > command rather than going for multiple steps of detach, alter, attach > partition. > Well, it's meant to get you a ballpark figure, but yes, it seems as though you will probably okay, But for something this critical involving production downtime, I would try out the exact command and see how long it takes on a test system. Restore a backup (you have backups I hope) or use pg_basebackup to make a copy of your prod system somewhere. Cheers, Greg