2

I have a table in PostgreSQL where one column "vat" has type money but I would like to alter it to decimal instead.

How can I do it?

I tried with:

alter table my_table alter column vat type decimal;

But I get this error:

ERROR:  column "vat" cannot be cast to type numeric

Any suggestions?

Jonas
  • 33,945
  • 27
  • 62
  • 64

1 Answers1

4

Try providing USING clause as described in docs:

A USING clause must be provided if there is no implicit or assignment cast from old to new type.

andreypopp
  • 156
  • 3