pg.ddx.io  pgsql-admin@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Laurenz Albe <laurenz.albe@cybertec.at>
To: David G. Johnston <david.g.johnston@gmail.com>
To: Walters Che Ndoh <chendohw@gmail.com>
Cc: Pgsql-admin <pgsql-admin@lists.postgresql.org>
Subject: Re: Change from BIGINT to INT in prod.
Date: Fri, 06 Nov 2020 09:27:22 +0100
Message-ID: <eba1e522e6a0cf69b6bca6c36e45f6d101670c84.camel@cybertec.at> (raw)
In-Reply-To: <CAKFQuwaU6gPLCAOr_8h48L7+wvjeL6cL_mBF+Mqjbg+6y+LM5A@mail.gmail.com>
References: <CAJ=HdqLoc-BHj7sRSSFVS6EeoC-GKcpaBqUnyvPdnGiizpY4gw@mail.gmail.com>
	<CAKFQuwaU6gPLCAOr_8h48L7+wvjeL6cL_mBF+Mqjbg+6y+LM5A@mail.gmail.com>

On Thu, 2020-11-05 at 11:23 -0700, David G. Johnston wrote:
> > So when i try running alter table table_name alter column column_name type INT; , it is hanging and starts providing a lock on the table.

It has to rewrite the table and needs an AccessExclusive lock.
You have to suspend all concurrent activity on that table.

> I'm not seeing the point of doing this specific conversion at all really

Exactly; this exercise is not necessary.
The few bytes you are saving are not worth the trouble.

Yours,
Laurenz Albe
-- 
+43-670-6056265
CYBERTEC PostgreSQL International GmbH
Gröhrmühlgasse 26, A-2700 Wiener Neustadt
Web: https://www.cybertec-postgresql.com






view thread (4+ messages)  latest in thread

Message-ID: <eba1e522e6a0cf69b6bca6c36e45f6d101670c84.camel@cybertec.at>
Permalink:  ../eba1e522e6a0cf69b6bca6c36e45f6d101670c84.camel@cybertec.at/
Also on:    postgresql.org/message-id/eba1e522e6a0cf69b6bca6c36e45f6d101670c84.camel@cybertec.at

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-admin@postgresql.org
  Cc: laurenz.albe@cybertec.at, david.g.johnston@gmail.com, chendohw@gmail.com, pgsql-admin@lists.postgresql.org
  Subject: Re: Change from BIGINT to INT in prod.
  In-Reply-To: <eba1e522e6a0cf69b6bca6c36e45f6d101670c84.camel@cybertec.at>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox