The table has a type column Double precision, I can't replace Numeric due to the presence of cells "infinity"

ERROR: cannot convert infinity to numeric

How do I replace the "infinity" to NaN in order to convert the data type of a column in a table?

I would be grateful for help