Re: New version of money type - Mailing list pgsql-hackers

From Martijn van Oosterhout
Subject Re: New version of money type
Date
Msg-id 20060929101907.GD8702@svana.org
Whole thread Raw
In response to Re: New version of money type  ("Jim C. Nasby" <jim@nasby.net>)
Responses Re: New version of money type  (tomas@tuxteam.de)
List pgsql-hackers
On Thu, Sep 28, 2006 at 06:32:11PM -0500, Jim C. Nasby wrote:
> What would be ideal is a money type that stored what currency was used
> and let you change precision (within reason).

The taggedtypes version of currency does half of that, by storing the
currency and allowing the output format to depend on that. It doesn't
allow you to easily change the precision though, that would require
user-defined typmod which is still under discussion.

It would be possible to create a taggedtypes version of currency based
on int64. With the currency tag it would be 12 bytes total. And the
number of decimal places could be defined per currency...

Interesting thought, probably wouldn't take more than an hour to whip
up.

Have a nice day,
--
Martijn van Oosterhout   <kleptog@svana.org>   http://svana.org/kleptog/
> From each according to his ability. To each according to his ability to litigate.

pgsql-hackers by date:

Previous
From: Martijn van Oosterhout
Date:
Subject: Re: Block B-Tree concept
Next
From: Heikki Linnakangas
Date:
Subject: Re: Block B-Tree concept