Carson
Carson

Reputation: 17751

PostgreSQL, How to re-cast a table column from Integer to Decimal?

I'd like to alter a PostgreSQL column to convert from integer to decimal, setting all integer values to <value>.0. How do I do this?

Upvotes: 1

Views: 942

Answers (1)

Andrew Lazarus
Andrew Lazarus

Reputation: 19320

ALTER TABLE my_table_name ALTER some_column TYPE decimal;

Relevant documentation.

Upvotes: 3

Related Questions