-- You cannot cast directly from `money` to `double precision`. First
-- cast to `numeric`:
ALTER TABLE tableName
ALTER price TYPE double precision USING price::numeric::double precision,
ALTER price DROP DEFAULT,
ALTER price SET NOT NULL;
-- This is actually explained in the [documentation][1]:
--
-- > Conversion from the real and double precision data types can be done
-- by casting to numeric first, for example:
--
-- >. SELECT '12.34'::float8::numeric::money;
--
-- [1]: https://www.postgresql.org/docs/current/datatype-money.html
--
-- [Gordon Linoff] [so/q/68538910] [cc by-sa 3.0]
$
cheat.sh