Re: New version of money type

From: tomas(at)tuxteam(dot)de
To: David Fetter <david(at)fetter(dot)org>
Cc: 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 08:23:14
Message-ID: 20060930082314.GA7651@www.trapp.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On Fri, Sep 29, 2006 at 10:43:53PM -0700, David Fetter wrote:
> On Sat, Sep 30, 2006 at 04:42:13AM +0000, tomas(at)tuxteam(dot)de wrote:
> > -----BEGIN PGP SIGNED MESSAGE-----
> > Hash: SHA1
> >
> > On Fri, Sep 29, 2006 at 12:19:07PM +0200, Martijn van Oosterhout wrote:
> > > On Thu, Sep 28, 2006 at 06:32:11PM -0500, Jim C. Nasby wrote:

[15 bit for three upcase ASCII]

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

Hm. But then you'd have to cope with a mapping (currency-id ->
description) which changes over time. Maybe it'd suffice to postulate
that "no id be reused".

> > That leaves forty-eightish bits for the number or about 10^14.
>
> By the above calculation, 56 bits or about 7.2 * 10^16.

Yes, way more useful than 10^14 (about a hundred times ;)

> It's not just dependent on time. Exchange rates vary in such a way
> that the relationships are not always transitive :P

:-)

Regards
- -- tomas
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.1 (GNU/Linux)

iD8DBQFFHilyBcgs9XrR2kYRAg+mAJ96+TTAjqEJK7J1nbI7EwVibYFoxwCfWElO
VJCskdQThqxI90gzTX+gR8A=
=OCN0
-----END PGP SIGNATURE-----

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Markus Schaber 2006-09-30 10:25:25 Re: Backup and restore through JDBC
Previous Message David Fetter 2006-09-30 05:43:53 Re: New version of money type