Return to site

Postgresql cast numeric

broken image
broken image

Conversion to other types could potentially lose precision, and must also be done in two stages: Floating point numbers should not be used to handle money due to the potential for rounding errors.Ī money value can be cast to numeric without loss of precision. Conversion from the real and double precision data types can be done by casting to numeric first, for example: Values of the numeric, int, and bigint data types can be cast to money. To avoid problems, before restoring a dump into a new database make sure lc_monetary has the same or equivalent value as in the database that was dumped.

broken image

Since the output of this data type is locale-sensitive, it might not work to load money data into a database that has a different setting of lc_monetary.

broken image