Re: type money causes unrestorable dump - Mailing list pgsql-hackers

From D'Arcy J.M. Cain
Subject Re: type money causes unrestorable dump
Date
Msg-id 20071104121009.979e1b20.darcy@druid.net
Whole thread Raw
In response to Re: type money causes unrestorable dump  (Tom Lane <tgl@sss.pgh.pa.us>)
Responses Re: type money causes unrestorable dump  (Bruce Momjian <bruce@momjian.us>)
List pgsql-hackers
On Sat, 03 Nov 2007 15:47:40 -0400
Tom Lane <tgl@sss.pgh.pa.us> wrote:
> Greg's objection caused me to rethink that.  Doing it would be a problem
> when transporting dump files across platforms: what if the appropriate
> locale name is spelled differently on the new machine?  We should
> probably leave it in the user's hands to get this right.  So the added
> text could be used as I suggested, or tweaked to say that you must set
> lc_monetary to something equivalent to the prior setting.

OK, how is this?

Index: doc/src/sgml/datatype.sgml
===================================================================
RCS file: /cvsroot/pgsql/doc/src/sgml/datatype.sgml,v
retrieving revision 1.211
diff -u -p -u -r1.211 datatype.sgml
--- doc/src/sgml/datatype.sgml  21 Oct 2007 20:04:37 -0000      1.211
+++ doc/src/sgml/datatype.sgml  4 Nov 2007 17:09:03 -0000
@@ -834,14 +834,6 @@ ALTER SEQUENCE <replaceable class="param  <sect1 id="datatype-money">   <title>Monetary
Types</title>

-   <note>
-    <para>
-     The <type>money</type> type is deprecated. Use
-     <type>numeric</type> or <type>decimal</type> instead, in
-     combination with the <function>to_char</function> function.
-    </para>
-   </note>
-   <para>    The <type>money</type> type stores a currency amount with a fixed    fractional precision; see <xref
@@ -852,6 +844,14 @@ ALTER SEQUENCE <replaceable class="param    Output is generally in the latter form but depends on
thelocale.   </para>
 

+   <para>
+    Since the output of this data type is locale-sensitive, it may not
+    work to load <type>money</> data into a database that has a different
+    setting of <varname>lc_monetary</>.  To avoid problems, before
+    restoring a dump make sure <varname>lc_monetary</> has the same or
+    equivalent value as in the database that was dumped.
+   </para>
+    <table id="datatype-money-table">     <title>Monetary Types</title>     <tgroup cols="4">


-- 
D'Arcy J.M. Cain <darcy@druid.net>         |  Democracy is three wolves
http://www.druid.net/darcy/                |  and a sheep voting on
+1 416 425 1212     (DoD#0082)    (eNTP)   |  what's for dinner.


pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: should I worry?
Next
From: Greg Smith
Date:
Subject: Re: Test lab