Re: type money causes unrestorable dump

From: "D'Arcy J(dot)M(dot) Cain" <darcy(at)druid(dot)net>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Peter Eisentraut <peter_e(at)gmx(dot)net>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: type money causes unrestorable dump
Date: 2007-11-04 17:10:09
Message-ID: 20071104121009.979e1b20.darcy@druid.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Sat, 03 Nov 2007 15:47:40 -0400
Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)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 the locale.
</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(at)druid(dot)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.

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Greg Smith 2007-11-04 18:02:48 Re: Test lab
Previous Message Tom Lane 2007-11-04 17:05:15 Re: should I worry?