Changing Data Type on Production Database - Impact - Mailing list pgsql-admin

From Raj kumar
Subject Changing Data Type on Production Database - Impact
Date
Msg-id CACxU--UnGQzyiLnOkGAoEZ16S0LJGFXUthirZFxO6mq=CqF4fQ@mail.gmail.com
Whole thread Raw
List pgsql-admin

Hi,


I have a UseCase to modify the Data Types of some columns in a Table as specified below. 

How much time does it take approximately for modifying a 30GB table? Should I perform this only during Downtime or can I do it on a Production Database?


Data Type Changes,

test=> alter table speed1 alter column expireat type date USING expireat::date;

ALTER TABLE

 

test=> alter table speed1 alter column condition type jsonb[] USING condition::jsonb[];

ALTER TABLE

 

test=> alter table speed1 alter column last_login type timestamp with time zone USING last_login::timestamp with time zone;

ALTER TABLE


test=> alter table speed1 alter column remote_addr type inet USING remote_addr::inet;

ALTER TABLE


Thanks,

Raj Kumar Narendiran.

pgsql-admin by date:

Previous
From: Raj kumar
Date:
Subject: Logical Replication - Initial Snapshot Only mode
Next
From: A G
Date:
Subject: Re: Losing records in PostgreSQL 9.6