Changing Data Type on Production Database - Impact

From: Raj kumar <rajkumar820999(at)gmail(dot)com>
To: Pgsql-admin <pgsql-admin(at)lists(dot)postgresql(dot)org>
Cc: Raj kumar <rajkumar820999(at)gmail(dot)com>
Subject: Changing Data Type on Production Database - Impact
Date: 2022-06-03 21:49:02
Message-ID: CACxU--UnGQzyiLnOkGAoEZ16S0LJGFXUthirZFxO6mq=CqF4fQ@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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.

Browse pgsql-admin by date

  From Date Subject
Next Message A G 2022-06-04 09:19:21 Re: Losing records in PostgreSQL 9.6
Previous Message Jack DeVries 2022-06-03 20:18:10 Re: Fwd: Adding more detail to pg_upgrade documentation