Re: trying to alter column - Mailing list pgsql-admin

From Scott Marlowe
Subject Re: trying to alter column
Date
Msg-id dcc563d10908191944q79529767ic7c46ffa99f2675@mail.gmail.com
Whole thread Raw
In response to trying to alter column  (Aras Angelo <araskoktas@gmail.com>)
List 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 by date:

Previous
From: Aras Angelo
Date:
Subject: trying to alter column
Next
From: Kevin Kempter
Date:
Subject: help tuning query