Re: Changed a column type from "integer" to varchar

Поиск
Список
Период
Сортировка
От Ying Lu
Тема Re: Changed a column type from "integer" to varchar
Дата
Msg-id 41475D69.7050605@cs.concordia.ca
обсуждение исходный текст
Ответ на Re: Changed a column type from "integer" to varchar  (Greg Donald <destiney@gmail.com>)
Список pgsql-general
Currently, what I did is like

. alter table test add column machineIDnew varchar;
. update test set machineIDnew = machineID;
. alter table test rename machineIDnew to machineID;
. vacuum full table;

If better ways, please let me know.

Thanks a lot,


Greg Donald wrote:

>On Tue, 14 Sep 2004 13:33:32 -0700, Joshua D. Drake
><jd@commandprompt.com> wrote:
>
>
>>You can not currently change the data type with alter table.
>>
>>
>
>Are there any plans to add this functionality?
>
>What's the best workaround?  Add a new column, copy data from old
>column to new column, drop old column?
>
>
>
>


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

Предыдущее
От: Jerome Lyles
Дата:
Сообщение: Spacing in output
Следующее
От: Alvaro Herrera
Дата:
Сообщение: Re: Changed a column type from "integer" to varchar