Re: Smartest way to resize a column?

From: Ow Mun Heng <Ow(dot)Mun(dot)Heng(at)wdc(dot)com>
To: Phoenix Kiula <phoenix(dot)kiula(at)gmail(dot)com>
Cc: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, Adrian Klaver <aklaver(at)comcast(dot)net>, Ian Barwick <barwick(at)gmail(dot)com>, PG-General Mailing List <pgsql-general(at)postgresql(dot)org>
Subject: Re: Smartest way to resize a column?
Date: 2009-03-04 09:40:16
Message-ID: 1236159616.3941.0.camel@localhost.localdomain
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Mon, 2009-01-12 at 14:42 +0800, Phoenix Kiula wrote:
> > ALTER COLUMN TYPE is intended for cases where actual transformation of
> > the data is involved. Obviously varchar(20) to varchar(35) doesn't
> > really require any per-row effort, but there's no operation in the
> > system that handles that case. But if you're brave, you can do it
> > via manipulation of the system catalogs. Observe:
>
> ...snip....
>
>
> Thanks Tom. Yes, no data change is required. But I don't think I have
> the understanding to try what you suggested. Running the alter table
> on my home database (almost same data) took an hour and it wasn't
> complete. I had even dropped the index. So I guess altering it that
> way is a pain in PGSQL. Bummer.
>

Actually, I did the same thing on a live database and it worked!

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Peter Eisentraut 2009-03-04 10:04:56 Re: Problem with Mauritius summer time (MUST)
Previous Message Richard Huxton 2009-03-04 09:19:49 Re: Date/time of last commit