Re: pg_dump and money type

From: Alvaro Herrera <alvherre(at)commandprompt(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Heikki Linnakangas <heikki(at)enterprisedb(dot)com>, Peter Eisentraut <peter_e(at)gmx(dot)net>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: pg_dump and money type
Date: 2007-09-12 01:35:40
Message-ID: 20070912013540.GD16107@alvh.no-ip.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Tom Lane wrote:
> "Heikki Linnakangas" <heikki(at)enterprisedb(dot)com> writes:
> > Tom Lane wrote:
> >> This risk seems rather overstated, as it's unlikely that someone using
> >> money would choose to reload their data into a DB with a fundamentally
> >> incompatible locale setting.
>
> > It doesn't sound unlikely at all to me. For example, people often use
> > C-locale for performance reasons, or because of ignorance of locale
> > issues. One scenario that seems particularly likely is to initialize and
> > load a database with en_US or C locale, and run like that for a few
> > weeks. After that, you notice that something's wrong, strings are sorted
> > in a funny way, etc. You realize that you're using the wrong locale, so
> > you take a backup with pg_dump, re-initdb with correct locale, and restore.
>
> If you're using type money, you will certainly have noticed whether it
> spells the currency sign the way you like. I can believe that someone
> might go for a while with C where they should have used en_US, or vice
> versa, but not that they'd have failed to notice the difference between
> $ and DM, say.

Well, that assumes that countries use different signs. We for example
use $, as does Argentina (but they add two decimal places where we have
none), Mexico and US. And while both Arg. and Mexico use $ and 2
decimal places, the former uses "," for decimals while the latter
follows the US lead and uses ".".

--
Alvaro Herrera http://www.CommandPrompt.com/
PostgreSQL Replication, Consulting, Custom Development, 24x7 support

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message ITAGAKI Takahiro 2007-09-12 01:47:58 CVS HEAD is broken by flex
Previous Message Tom Lane 2007-09-12 00:59:29 Re: pg_dump and money type