Re: change bigint column to int

From: Evan Bauer <evanbauer(at)mac(dot)com>
To: Mariel Cherkassky <mariel(dot)cherkassky(at)gmail(dot)com>
Cc: pgsql-admin(at)lists(dot)postgresql(dot)org
Subject: Re: change bigint column to int
Date: 2018-11-01 11:54:50
Message-ID: 117C35AF-8395-4D7F-842B-A63B7141269B@mac.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-admin

Mariel,

Just run a query and make certain that all values currently stored in the column fit in 4 bytes (+/- 2,147,483,648) before doing the ALTER.

Cheers,

Evan

Sent from my iPhone

> On Nov 1, 2018, at 06:20, Mariel Cherkassky <mariel(dot)cherkassky(at)gmail(dot)com> wrote:
>
> Hi,
>
> I want to change the column type from bigint to int to save space. By doing so, does it include some risks ? As I see it, I should only run vacuum full afterwards if I want to return space to the os right ?
>

In response to

Responses

Browse pgsql-admin by date

  From Date Subject
Next Message Mariel Cherkassky 2018-11-01 12:54:07 Re: change bigint column to int
Previous Message Mariel Cherkassky 2018-11-01 11:12:26 Re: change bigint column to int