I have a column (phase_mapped) in PostgreSQL 11.0 with integers and n/a values. Current datatype of the column in nchar(3). I would like to convert the datatype of this column to integer but n/a is throwing an error. How can I set int datatype of such columns.
phase phase_mapped
Phase 1 1
Phase 2 2
n/a n/a
I tried following query
ALTER TABLE table
ALTER COLUMN phase_mapped TYPE INT USING phase_mapped::integer;
Any help is highly appreciated