## Re: Money type not gone?

From: Andreas Pflug Josh Berkus Karel Zak , Tom Lane ,pgsql-bugs(at)postgresql(dot)org Re: Money type not gone? 2004-09-21 18:29:56 41507324.3080907@pse-consulting.de (view raw or whole thread) 2004-09-17 17:34:23 from Josh Berkus  2004-09-19 19:29:28 from Tom Lane   2004-09-20 00:07:16 from Josh Berkus    2004-09-20 06:18:23 from Peter Eisentraut   2004-09-20 08:25:24 from Karel Zak    2004-09-20 08:36:27 from Andreas Pflug     2004-09-20 09:42:34 from Karel Zak      2004-09-20 10:04:51 from Andreas Pflug       2004-09-21 17:42:49 from Josh Berkus        2004-09-21 18:29:56 from Andreas Pflug pgsql-bugs
```Josh Berkus wrote:
>
> The difference with currency would be the lack of a fixed conversion for
> different units.    For example, you can:

You're mixing up quite a lot of stuff here.

> 10m == 1000cm

This is just what I considered forbidden to be included in that "unit-ed
type" in my previous mail. c = centi is a scale, which is up to a view
conversion, and should not be stored. It would be a pain to calculate
with it.

> 7l == 0.07m^3

l is not a SI unit, m^3 is. See below for further handling

> But you can't reasonably:
>
> 10USD == 6.25UKL

Yes, right. USD and UKL are different units, and units are generally not
convertible. If you want one from the other, you always have to multiply
it by something that adapts the units. 1kg = .001m^3 is never true, it
needs 1000kg/m^3 as factor for water. Unfortunately, for currencies this
isn't fixed (it isn't fixed for water either).

l is an abbrevation for .001m^3. If you'd really decide to handle it as
unit in the "unit-ed type", it wouldn't be convertible either. Since in
real life l and m^3 are rarely used interchanged on a specific item,
this seems acceptable.

> ... because that would require a query to money.yahoo.com to establish.

It's even more complicated. In practice, real time rates of exchanges
are much less frequent than point in time rates.

Regards,
Andreas

```

### pgsql-bugs by date

 Next: From: PostgreSQL Bugs List Date: 2004-09-21 20:26:40 Subject: BUG #1261: CREATE DATABASE OWNER not propagating to child objects? Previous: From: Josh Berkus Date: 2004-09-21 17:42:49 Subject: Re: Money type not gone?