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

From Alban Hertroys
Subject Re: Column type modification in big tables
Date
Msg-id 7D2FBDFB-40DD-4458-B213-03EB7311EC4D@gmail.com
Whole thread Raw
In response to Re: Column type modification in big tables  (Lok P <loknath.73@gmail.com>)
List pgsql-general
> On 8 Aug 2024, at 20:38, Lok P <loknath.73@gmail.com> wrote:
>
> Thank you so much.
>
> Can anybody suggest any other possible way here. As, we also need to have the existing values be updated to the new
columnvalue here using update command (even if it will update one partition at a time). And as I see we have almost all
thevalues in the column not null, which means it will update almost ~5billion rows across all the partitions. So my
questionis , is there any parameter(like work_mem,maintenance_work_mem etc) which we can set to make this update
faster?
>  or any other way to get this column altered apart from this method?

Just a wild thought here that I’m currently not able to check… Can you add views as partitions? They would be read-only
ofcourse, but that would allow you to cast the columns in your original partitions to the new format, while you can add
anynew partitions in the new format. 

I suspect it’s not allowed, but perhaps worth a try.

Alban Hertroys
--
There is always an exception to always.







pgsql-general by date:

Previous
From: Alban Hertroys
Date:
Subject: Re: Destination Table - Condition Amount 0
Next
From: Adrian Klaver
Date:
Subject: Re: Destination Table - Condition Amount 0