Re: Altering a column type - Most efficient way

Поиск
Список
Период
Сортировка
От Ow Mun Heng
Тема Re: Altering a column type - Most efficient way
Дата
Msg-id 1215682481.15319.14.camel@neuromancer.home.net
обсуждение исходный текст
Ответ на Re: Altering a column type - Most efficient way  (Mario Weilguni <mweilguni@sime.com>)
Ответы Re: Altering a column type - Most efficient way
Список 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 по дате отправления:

Предыдущее
От: Mario Weilguni
Дата:
Сообщение: Re: Altering a column type - Most efficient way
Следующее
От: Jessica Richard
Дата:
Сообщение: how big shmmax is good for Postgres...