Re: Changing data types

Поиск
Список
Период
Сортировка
От Hannu Krosing
Тема Re: Changing data types
Дата
Msg-id 3BAF4B4A.20250FFE@tm.ee
обсуждение исходный текст
Ответ на Changing data types  ("Gowey, Geoffrey" <ggowey@rxhope.com>)
Список pgsql-hackers
"Gowey, Geoffrey" wrote:
> 
> I posted this in my last message, but have not heard anything yet so I'm
> wondering if it was overlooked.  I need to know how to change a column from
> being say a varchar(9) to an integer.  Does anyone know how to change the
> data type?

create temptableas select col_a, col_b, varchar9col_c::int, col_d from originaltable
;

drop table originaltable;

alter table temptable rename to originaltable;



and then create all indexes and constraints.

---------------
Hannu


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

Предыдущее
От: "Gowey, Geoffrey"
Дата:
Сообщение: Re: Changing data types
Следующее
От: Hannu Krosing
Дата:
Сообщение: Re: Changing data types