Re: Money casting too liberal?

From: Shaun Thomas <sthomas(at)optionshouse(dot)com>
To: John R Pierce <pierce(at)hogranch(dot)com>
Cc: <pgsql-general(at)postgresql(dot)org>
Subject: Re: Money casting too liberal?
Date: 2013-03-28 21:42:58
Message-ID: 5154B962.6090207@optionshouse.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On 03/28/2013 04:36 PM, John R Pierce wrote:

> or to another extreme, part of the data, such that different rows could
> have different monetary units. (eg, money is implemented as a pair
> (currency,amount). eeek, then you'd need exchange rate tables and
> such. hahahahaha, what a nightmare.

Naw. Only if you wanted to convert them. I personally wonder why it
wasn't implemented this way to begin with. Like TSTZ, with a MONEY type,
the currency is the TZ segment. XXX amount in YYY encoding, with the
default being the currency of the locale if not otherwise specified. It
would still be useless for calculations in applications requiring more
significant figures, but would make more sense than the currently
magically morphing value it is now.

"Hey, we just shipped a DB server to Japan, and now all of the monetary
values are wrong. WTF!"

Yeah... no. :)

--
Shaun Thomas
OptionsHouse | 141 W. Jackson Blvd. | Suite 500 | Chicago IL, 60604
312-676-8870
sthomas(at)optionshouse(dot)com

______________________________________________

See http://www.peak6.com/email_disclaimer/ for terms and conditions related to this email

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Jasen Betts 2013-03-28 21:53:42 Re: Unexpected behaviour of encode()
Previous Message Jasen Betts 2013-03-28 21:36:18 Re: Understanding behavior of SELECT with multiple unnested columns