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

From: tomas(at)fabula(dot)de
To: pgsql-bugs(at)postgresql(dot)org
Subject: Re: [pgsql-bugs] Daily Digest V1 #784
Date: 2003-01-29 13:14:02
Message-ID: 20030129131402.GC17090@www
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

On Tue, Jan 28, 2003 at 17:47:14 -0500, tom lane wrote:

[...]

> Peter Eisentraut <peter_e(at)gmx(dot)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

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message Darcy Buskermolen 2003-01-29 16:41:09 Re: No migration path for MONEY
Previous Message Karel Zak 2003-01-29 09:11:35 Re: No migration path for MONEY