Re: Money casting too liberal? - Mailing list pgsql-general

From D'Arcy J.M. Cain
Subject Re: Money casting too liberal?
Date
Msg-id 20130329123254.37edf7d3@imp
Whole thread Raw
In response to Re: Money casting too liberal?  (Tom Lane <tgl@sss.pgh.pa.us>)
Responses Re: Money casting too liberal?
List pgsql-general
On Fri, 29 Mar 2013 11:46:40 -0400
Tom Lane <tgl@sss.pgh.pa.us> wrote:
> Well, this has been discussed before, and the majority view every
> time has been that MONEY is a legacy thing that most people would
> rather rip out than sink a large amount of additional effort into.
> It has some use-cases but they are narrow, and it's not clear how
> much wider the use-cases would be if we tried to generalize it.

I wonder if our vision isn't a little tunneled here.  Using this type
for money is, perhaps, a specialized use and the type should really be
called something else and modified to remove all connotations of money
from it.  So...

 - Drop the currency symbol
 - Allow number of decimals to be defined once for the column
 - Don't use locale except to specify decimal separator (',' vs. '.')
 - Allow operations against numeric

Not sure what to rename it to.  Decimal would be good if it wasn't
already in use.  Maybe DecimalInt.

> My own experience with this sort of thing leads me to think that
> real applications dealing with a variety of currencies will be
> needing to store additional details, such as the exact exchange
> rate that applied to a particular transaction.  So while merely

Seems like something that can be stored in a different column.

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


pgsql-general by date:

Previous
From: Lonni J Friedman
Date:
Subject: Re: Streaming replication slave crash
Next
From: Quentin Hartman
Date:
Subject: Re: Streaming replication slave crash