Re: How to do faster DML

From: Ron Johnson <ronljohnsonjr(at)gmail(dot)com>
To: "pgsql-generallists(dot)postgresql(dot)org" <pgsql-general(at)lists(dot)postgresql(dot)org>
Subject: Re: How to do faster DML
Date: 2024-02-14 05:00:12
Message-ID: CANzqJaDg4C-i=koB4v1x_nrherdKsHVQm5dP1GMTc-yooKfd3A@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Tue, Feb 13, 2024 at 4:17 PM veem v <veema0000(at)gmail(dot)com> wrote:
[sni[]

> One question here, if we have defined one column as a fixed length data
> type "integer" and slowly we noticed the length of data keeps increasing
> (in case of a sequence generated PK column which will keep increasing), and
> we want to alter the column to "bigint" now. In such scenario, will it
> append/pad the additional spaces to all the existing values which were
> already stored with integer type initially in the table. And that would be
> then an increase to the existing table storage. Please correct me if I'm
> wrong.
>

ALTER TABLE foo ALTER COLUMN bar BIGINT; rewrites the whole table. Do
yourself a favor, and start with BIGINT.

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Simon Connah 2024-02-14 09:59:01 PostgreSQL DB in prod, test, debug
Previous Message veem v 2024-02-13 21:16:48 Re: How to do faster DML