Re: No migration path for MONEY - Mailing list pgsql-bugs

From Tom Lane
Subject Re: No migration path for MONEY
Date
Msg-id 4564.1043794034@sss.pgh.pa.us
Whole thread Raw
In response to Re: No migration path for MONEY  (Peter Eisentraut <peter_e@gmx.net>)
List pgsql-bugs
Peter Eisentraut <peter_e@gmx.net> writes:
> How would the new "money" be different from "numeric"?

[ temporarily re-dons currency-trader hat... ]

What would actually be useful is a money type that carries along an
indication of which currency the amount is expressed in (not per-column
as Bruce naively suggested, but right in the datum).  This would allow
conversions to be performed between different currencies, as well as
allowing the correct decoration to be provided on output.

> If we have "money", should we have "length", "mass", and
> "temperature"?  I think not.

Physicists have found use for numeric objects that carry along an
indication of the units they're in --- in other words, not "length" etc,
but a generic "measurement" type that might tag its value as "meters" or
"kilograms" or "furlongs per fortnight".

I'm not eager to go and write such a datatype right now, but if someone
wanted to do the work I'd be in favor of adopting one.

            regards, tom lane

pgsql-bugs by date:

Previous
From: Tom Lane
Date:
Subject: Re: Bug in LIKE operator processing
Next
From: Tom Lane
Date:
Subject: Re: pgtcl combined with view with certain insert/update-rules => crash