Change type of varchar field to integer: “cannot be cast automatically to type integer”

I have a small table and a certain field contains the type “character varying“. I’m trying to change it to “Integer” but it gives an error that casting is not possible.

Is there a way around this or should I just create another table and bring the records into it using a query.

The field contains only integer values.

9 Answers
9

Leave a Comment