Re: alter the datatype of Partition Key - Mailing list pgsql-admin

From akshay polji
Subject Re: alter the datatype of Partition Key
Date
Msg-id CAHecRemysNd-X8hrv_jEJ4OPMB6G2SwVV7dDZcmYbze4rmCXRQ@mail.gmail.com
Whole thread Raw
List pgsql-admin
The cleanest way to do this would be to create a new table with varchar datatype for the partition key along with the partitions and then move the data partition-by-partition. 
The rollback would be super easy as well in case some issues arise in applications due to change of datatype. 

Regards,
Akshay 

On Mon, Jun 16, 2025 at 6:47 PM Gambhir Singh <gambhir.singh05@gmail.com> wrote:
Please help me on this

Thanks & Regards
Gambhir Singh



On Mon, 16 Jun 2025 at 12:45, Gambhir Singh <gambhir.singh05@gmail.com> wrote:
Hi,

We have a partition table with partitioning type range and got the requirement from the application team to alter the datatype of partitioning key from bigint to varchar. Please suggest to me the way how this can be achieved.

Data volume is quite huge in the table. ~50 Billion rows

--
Thanks & Regards
Gambhir Singh

pgsql-admin by date:

Previous
From: "Gaspare Boscarino, P.Eng."
Date:
Subject: Re: Upgrade from 12.22 to 16
Next
From: Scott Ribe
Date:
Subject: Re: update behavior