From: Ow Mun Heng <Ow.Mun.Heng@wdc.com>
To: Mario Weilguni <mweilguni@sime.com>
Cc: Pgsql performance <pgsql-performance@postgresql.org>
Subject: Re: Altering a column type - Most efficient way
Date: Thu, 10 Jul 2008 17:34:41 +0800
Message-ID: <1215682481.15319.14.camel@neuromancer.home.net> (raw)
In-Reply-To: <4875C9FA.7020101@sime.com>
References: <1215676380.15319.2.camel@neuromancer.home.net>
<4875C9FA.7020101@sime.com>
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.
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 from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-performance@postgresql.org
Cc: Ow.Mun.Heng@wdc.com, mweilguni@sime.com
Subject: Re: Altering a column type - Most efficient way
In-Reply-To: <1215682481.15319.14.camel@neuromancer.home.net>
References: <1215676380.15319.2.camel@neuromancer.home.net> <4875C9FA.7020101@sime.com> <1215682481.15319.14.camel@neuromancer.home.net>
* 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