Re: increasing varchar column size is taking too much time

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: AI Rumman <rummandba(at)gmail(dot)com>
Cc: pgsql-general General <pgsql-general(at)postgresql(dot)org>
Subject: Re: increasing varchar column size is taking too much time
Date: 2015-02-14 15:41:42
Message-ID: 27089.1423928502@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

AI Rumman <rummandba(at)gmail(dot)com> writes:
> I started the following query in Postgresql 9.1 where only this sql is
> running on the host and it has been taking more than an hour and still
> running.
> alter table userdata.table1 alter column name type varchar(512);

Pre-9.2 releases don't realize that that doesn't require a table rewrite.

You can either wait it out, or if you're feeling brave, manually modify
the column's pg_attribute.atttypmod field.

regards, tom lane

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Shanker Singh 2015-02-14 15:42:24 parallel dump fails to dump large tables
Previous Message Berend Tober 2015-02-14 14:32:08 Re: How to hide stored procedure's bodies from specific user