Re: How to alter the size of a column

Поиск
Список
Период
Сортировка
От Stephan Szabo
Тема Re: How to alter the size of a column
Дата
Msg-id Pine.BSF.4.10.10008010947580.23881-100000@megazone23.bigpanda.com
обсуждение исходный текст
Ответ на How to alter the size of a column  ("Cheng Kai" <chengk@isse.kuis.kyoto-u.ac.jp>)
Список pgsql-general
Right now the best way is probably:

create table newtable ( ... new column info ... )
insert into newtable select * from oldtable;
alter table oldtable rename to old_oldtable;
alter table newtable rename to oldtable;

In the second line, you may not be able to get away with a
* if you're doing more complicated changes of types that
can't automatically converted.  And once you're done and
sure everything is working,  you can delete the backup of
the old table.

Stephan Szabo
sszabo@bigpanda.com

On Tue, 1 Aug 2000, Cheng Kai wrote:

> Hi,
>
>      I want to alter the size of a column, say from char(40) to char(80),
> but it seem that
> the  ALTER does not support such operation, nor does it support column
> removing.
>
>      How can I do for this ?
>
>
>      Thanks
>


В списке pgsql-general по дате отправления:

Предыдущее
От: brianb-pggeneral@edsamail.com
Дата:
Сообщение: Re: [HACKERS] pg_dump & performance degradation
Следующее
От: jeff seaman
Дата:
Сообщение: auto rollback