Re: New version of money type

From: David Fetter <david(at)fetter(dot)org>
To: Xiaofeng Zhao <xf10036(at)hotmail(dot)com>
Cc: tomas(at)tuxteam(dot)de, Martijn van Oosterhout <kleptog(at)svana(dot)org>, "Jim C(dot) Nasby" <jim(at)nasby(dot)net>, "D'Arcy J(dot)M(dot) Cain" <darcy(at)druid(dot)net>, llonergan(at)greenplum(dot)com, sfrost(at)snowman(dot)net, pgsql-hackers(at)postgreSQL(dot)org
Subject: Re: New version of money type
Date: 2006-09-30 15:57:04
Message-ID: 20060930155703.GI24766@fetter.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Sat, Sep 30, 2006 at 11:36:04AM -0400, Xiaofeng Zhao wrote:
> >I feel silly for even mentioning this, but there are less than 256
> >countries in the UN, and as far as I know, each has at most one
> >currency, so you could use 8 bits instead of 15.
> >
> That's not always true, e.g. China has RMB and HKD. Also Taiwan is
> not a member country of UN but I don't think one would exclude TWD.

Right. There are several countries whose currency is USD, so I still
contend that at any given instant, there are fewer than 256
currencies, so we're back to 8 bits.

> There'll also times a country may transit from one currency to
> another. Even a currency (currency of most continental European
> countries before Euro) is no more being used, it may still need to
> be supported.

The "money" type is far too simplistic to model this kind of thing. A
really sophisticated representation of money would have to take time,
inflation/deflation, pairwise exchange rates, etc. into account. It
would look more like a schema with a large data set and a large body
of code loaded into it than it would a data type.

Cheers,
D
--
David Fetter <david(at)fetter(dot)org> http://fetter.org/
phone: +1 415 235 3778 AIM: dfetter666
Skype: davidfetter

Remember to vote!

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2006-09-30 17:00:05 Re: New version of money type
Previous Message Xiaofeng Zhao 2006-09-30 15:36:04 Re: New version of money type