I have a postgres table called update_profile with a column that is a table:

And I want to alter this column to a smallint containing the value of update_type_id.
Initially I tried:
ALTER TABLE update_profile ALTER COLUMN update_type TYPE SMALLINT USING update_type.update_type_id;
But I had the following error: missing FROM-clause entry for table "update_type"
Then I tried:
ALTER TABLE update_profile AS u ALTER COLUMN u.update_type TYPE SMALLINT USING u.update_type.update_type_id;
Which is not allowed.
Note: update_type_id is also a smallint
Is there a way to do this operation?
update_typecolumn seems completely useless in that case. Why not simply drop it entirely?update_type. But you gave me an idea, I could create a new column calledupdate_type_id, pass the content ofupdate_type.update_type_idthere and then deleteupdate_type.