Re: trying to alter column

Поиск
Список
Период
Сортировка
От Scott Marlowe
Тема Re: trying to alter column
Дата
Msg-id dcc563d10908191944q79529767ic7c46ffa99f2675@mail.gmail.com
обсуждение исходный текст
Ответ на trying to alter column  (Aras Angelo <araskoktas@gmail.com>)
Список pgsql-admin
On Wed, Aug 19, 2009 at 6:20 PM, Aras Angelo<araskoktas@gmail.com> wrote:
> Im trying to alter a column type from character varying(8) to int.
> All the values in the column are numbers but im getting this message
>
> column "xxxxxx" cannot be cast to type integer
>
> Dropping and readding the column is an option but downtime is very critical
> to us, so i was wondering
> if im doing something wrong and i can alter type somehow.

alter table xyz alter COLUMN i type int using i::int;

Note that this will fail if any of the entries in teh column i are not ints.

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

Предыдущее
От: Aras Angelo
Дата:
Сообщение: trying to alter column
Следующее
От: Kevin Kempter
Дата:
Сообщение: help tuning query