Modify/Increase/Decrease the data type of a column

Moderator: NorbertKrupa

Post Reply
samuel_mahanty
Newbie
Newbie
Posts: 5
Joined: Thu Mar 26, 2015 4:45 pm

Modify/Increase/Decrease the data type of a column

Post by samuel_mahanty » Tue May 12, 2015 5:00 pm

Hi,

I need to increase the data type of a column.
I need to increase the data type of a column from numeric(10,2) to numeric(20,2)
I am using the below command -
ALTER TABLE t ALTER COLUMN c SET DATA TYPE numeric (20,2);
but it fails giving the following error -
Error Code: 2377, SQL State: 0A000] [Vertica][VJDBC](2377) ROLLBACK: Cannot convert column c from "numeric(10,2)" to type "numeric(20,2)"

Any help would be much appreciated.

Thanks,
Samuel
Regards,
Samuel

adrian.oprea
Intermediate
Intermediate
Posts: 163
Joined: Tue Jun 19, 2012 2:44 pm
Location: Rio de Janeiro
Contact:

Re: Modify/Increase/Decrease the data type of a column

Post by adrian.oprea » Tue May 12, 2015 7:12 pm

Not possible , even if you have no data in that table !
See more details here. About restrictions.
http://my.vertica.com/docs/7.1.x/HTML/i ... taType.htm?
trying so hard !!!

samuel_mahanty
Newbie
Newbie
Posts: 5
Joined: Thu Mar 26, 2015 4:45 pm

Re: Modify/Increase/Decrease the data type of a column

Post by samuel_mahanty » Tue May 12, 2015 7:31 pm

Thanks Adrian.
I am doing the long way of creating a new column and then dropping the old one and renaming the new one to old one.
Regards,
Samuel

Post Reply

Return to “New to Vertica Database Administration”