From: Bruce Momjian Date: Tue, 27 Nov 2007 05:49:58 +0000 (+0000) Subject: Add documentation about the issues of casting MONEY to/from numeric X-Git-Tag: REL8_3_BETA4~46 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=ee13b734fafe3bf090670c83547db718a877690d;p=postgresql Add documentation about the issues of casting MONEY to/from numeric types. --- diff --git a/doc/src/sgml/datatype.sgml b/doc/src/sgml/datatype.sgml index c67c626855..dccb88c8d8 100644 --- a/doc/src/sgml/datatype.sgml +++ b/doc/src/sgml/datatype.sgml @@ -1,4 +1,4 @@ - + Data Types @@ -842,6 +842,14 @@ ALTER SEQUENCE tablename_typical currency formatting, such as '$1,000.00'. Output is generally in the latter form but depends on the locale. + Non-quoted numeric values can be converted to money by + casting the numeric value to text and then + money: + +SELECT 1234::text::money; + + There is no simple way of doing the reverse; casting a money value to a + numeric type.