[GENERAL] Speed of conversion from int to bigint - Mailing list pgsql-general

From Jonathan Moules
Subject [GENERAL] Speed of conversion from int to bigint
Date
Msg-id 15ec2604a7d.e9912c3985278.6402582227177025587@lightpear.com
Whole thread Raw
Responses Re: [GENERAL] Speed of conversion from int to bigint  (Tomas Vondra <tomas.vondra@2ndquadrant.com>)
List pgsql-general
Hi,
(Postgres 9.5 and 9.6)
We have a table of about 650million rows. It's a partitioned table, with two "child" tables. We want to change its primary key type from int to bigint while retaining the current values.

We're using this:

ALTER TABLE dta.my_table ALTER column table_id TYPE bigint;

But it's taking a very long time, and locking the database. We're going to need to do this in production as well, so a long-term table-lock isn't workable.
Is there anything we can do to speed things up? How long is this likely to take?

Thanks,
Jonathan

pgsql-general by date:

Previous
From: Thomas Güttler
Date:
Subject: Re: [GENERAL] VM-Ware Backup of VM safe?: snapshots: quiesced andnon-quiesced
Next
From: Thomas Güttler
Date:
Subject: Re: [GENERAL] Final pg_dumpall should happen in Single-User-Mode