Thread: Re: [pgsql-bugs] Daily Digest V1 #784

Re: [pgsql-bugs] Daily Digest V1 #784

From
tomas@fabula.de
Date:
On Tue, Jan 28, 2003 at 17:47:14 -0500, tom lane wrote:

[...]

> 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.

Exactly. Except that for currency, you'd have to carry a timestamp
along with the units -- the conversion factor between meters and
inches is more or les constant, but the one between USD and YEN,
say not.

Come to think of it, even the point in time isn't enough (I remember
times where you got more Deutsche Mark for an US dollar in the Soviet
Union than you got in Western Germany). Oh, well...

> > 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".

It's an interesting idea, "magnitude-plus-unit" (note that the magnitude
itself could be a vector or a tuple). I had the same idea thinking of
the currency problem. But to tackle the currency problem you need a
notion of `complex units' (like `currency-plus-timestamp', if we want
to be simplistic).

Regards
-- tomas

Re: [pgsql-bugs] Daily Digest V1 #784

From
Vincent Janelle
Date:
Currency is always going to depend on the cost of who you are buying it
from, no?

On Wed, 29 Jan 2003 14:14:02 +0100
tomas@fabula.de wrote:

>
> Come to think of it, even the point in time isn't enough (I remember
> times where you got more Deutsche Mark for an US dollar in the Soviet
> Union than you got in Western Germany). Oh, well...
>