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

From tomas@fabula.de
Subject Re: [pgsql-bugs] Daily Digest V1 #784
Date
Msg-id 20030129131402.GC17090@www
Whole thread Raw
Responses Re: [pgsql-bugs] Daily Digest V1 #784
List pgsql-bugs
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

pgsql-bugs by date:

Previous
From: Karel Zak
Date:
Subject: Re: No migration path for MONEY
Next
From: Darcy Buskermolen
Date:
Subject: Re: No migration path for MONEY