Re: How to change column type in PostgreSQL 7.1.2

Поиск
Список
Период
Сортировка
От Dennis Gearon
Тема Re: How to change column type in PostgreSQL 7.1.2
Дата
Msg-id 3EE88DED.8D862081@cvc.net
обсуждение исходный текст
Ответ на How to change column type in PostgreSQL 7.1.2  ("Vilson farias" <vilson.farias@digitro.com.br>)
Ответы Re: How to change column type in PostgreSQL 7.1.2  ("scott.marlowe" <scott.marlowe@ihs.com>)
Список pgsql-general
drop key, Add a column, fill from old column, delete old column, rename
new column to old name, add key.

Watch out for indexes, functions, views, and especially referential
constraints against that column. This is one reason why I always use a
surrogate key.

this Will only work if you have unique rows.

Vilson farias wrote:
>
> Greetings,
>
>   I'm wondering if there is a way to change a column type in PostgreSQL
> 7.1.2 without reconstruction of table + pg_dump/restore of table data
> (machine can't be stopped for a long time). I have a table with a integer
> column and I would like to change it to varchar(20). One more thing, this
> collumn belongs to a composed primary key. Is it possible?
>
> Best regards
>
> ----------------------------------------------------------------------------
> ----
> Jos� Vilson de Mello de Farias
> Software Engineer
>
> D�gitro Tecnologia Ltda - www.digitro.com.br
> APC - Customer Oriented Applications
> E-mail: vilson.farias@digitro.com.br
> Tel.: +55 48 281 7158
> ICQ 11866179
>
> ---------------------------(end of broadcast)---------------------------
> TIP 1: subscribe and unsubscribe commands go to majordomo@postgresql.org

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

Предыдущее
От: Jonathan Bartlett
Дата:
Сообщение: Re: full featured alter table?
Следующее
От: Dennis Gearon
Дата:
Сообщение: Re: Postgres performance comments from a MySQL user