Re: Altering a column type - Most efficient way - Mailing list pgsql-performance

From Ow Mun Heng
Subject Re: Altering a column type - Most efficient way
Date
Msg-id 1215682481.15319.14.camel@neuromancer.home.net
Whole thread Raw
In response to Re: Altering a column type - Most efficient way  (Mario Weilguni <mweilguni@sime.com>)
Responses Re: Altering a column type - Most efficient way  (Alvaro Herrera <alvherre@commandprompt.com>)
List pgsql-performance
On Thu, 2008-07-10 at 10:36 +0200, Mario Weilguni wrote:
> Ow Mun Heng schrieb:
> >
> > I want to change a column type from varchar(4) to varchar()
> >
> >
> Example:
> {OLDLEN} = 4
> {NEWLEN} = 60
>
> update pg_attribute
>    set atttypmod={NEWLEN}+4
>  where attname='the-name-of-the-column'
>    and attrelid=(select oid from pg_class where
> relname='the-name-of-the-table')
>    and atttypmod={OLDLEN}+4;
>

This is what I see on the table

NEW attypmod = -1
OLD attypmod =  8

I'm not very confident in doint this change since this is not a
development server. If would help though if someone else has any other
suggestion or something.. Thanks for the information though, it's
enlightening knowledge.

pgsql-performance by date:

Previous
From: Mario Weilguni
Date:
Subject: Re: Altering a column type - Most efficient way
Next
From: Jessica Richard
Date:
Subject: how big shmmax is good for Postgres...