Add documentation about the issues of casting MONEY to/from numeric
authorBruce Momjian <bruce@momjian.us>
Tue, 27 Nov 2007 05:49:58 +0000 (05:49 +0000)
committerBruce Momjian <bruce@momjian.us>
Tue, 27 Nov 2007 05:49:58 +0000 (05:49 +0000)
types.

doc/src/sgml/datatype.sgml

index 0a96507c782bbbb0126597b158948d4fa67a9888..9294a3305fd5c7a2aca903c3b05931cca3f62843 100644 (file)
@@ -842,6 +842,14 @@ ALTER SEQUENCE <replaceable class="parameter">tablename</replaceable>_<replaceab
     floating-point literals, as well as <quote>typical</quote>
     currency formatting, such as <literal>'$1,000.00'</literal>.
     Output is generally in the latter form but depends on the locale.
+    Non-quoted numeric values can be converted to <type>money</type> by
+    casting the numeric value to <type>text</type> and then
+    <type>money</type>:
+<programlisting>
+SELECT 1234::text::money;
+</programlisting>
+    There is no simple way of doing the reverse;  casting a <type>money</type> value to a
+    numeric type.
    </para>
 
    <para>