Increasing size of array items without locking

From: Rowan Seymour <rowanseymour(at)gmail(dot)com>
To: pgsql-general(at)lists(dot)postgresql(dot)org
Subject: Increasing size of array items without locking
Date: 2018-02-02 15:26:46
Message-ID: CAEhK25rQj8mn4uGVMygfuLaFZAhqWj15aYnbPenatAHOczsOQw@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Hi. I'm trying to increase the size of items in an array column on a large
production database but it's locking the table. Is it correct than when you
make a field larger, it shouldn't lock because it doesn't have to check the
constraint on every row? For example expanding a VARCHAR column from 255
chars to 2048 chars.

Is the problem here that it is an array field?

ALTER TABLE "msgs_msg" ALTER COLUMN "attachments" TYPE varchar(2048)[]
USING "attachments"::varchar(2048)[];

Thanks

-Rowan
--
*Rowan Seymour* | +593 979099233 | @rowanseymour

Browse pgsql-general by date

  From Date Subject
Next Message Renzo Bertuzzi 2018-02-02 15:37:26 Postgres Planner "Inconsistency"?
Previous Message Pavan Teja 2018-02-02 12:47:44 Re: FATAL: failed to create a backend connection