Adding New Column with default value.

From: Gambhir Singh <gambhir(dot)singh05(at)gmail(dot)com>
To: pgsql-admin(at)lists(dot)postgresql(dot)org
Subject: Adding New Column with default value.
Date: 2025-04-28 17:24:11
Message-ID: CAHOGQfVmfJ5rpxfMSqJjTZGqN5ss-hdsCdTHsrxHAi2mUwWwmw@mail.gmail.com
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-admin

I got request from app Team to add new column to a table with following
specifications

1. With Not Null Constraint
2. With Default value 0

Row Count - 50 Billion

Please help me to understand
a. DDL statement (alter table add column) will be followed by the DML
statement (Update)....Am I correct ?
b. What would be size of the Table (I assuming it will be doubled)
c. What is the best approach for this kind of activity.

Thanks & Regards
Gambhir Singh

Responses

Browse pgsql-admin by date

  From Date Subject
Next Message Ron Johnson 2025-04-28 17:46:15 Re: Adding New Column with default value.
Previous Message Sbob 2025-04-28 14:10:57 Re: Intermittent missing chunk ERRORS