Skip site navigation (1) Skip section navigation (2)

Re: New version of money type

From: "D'Arcy J(dot)M(dot) Cain" <darcy(at)druid(dot)net>
To: Martijn van Oosterhout <kleptog(at)svana(dot)org>
Cc: 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-28 21:19:47
Message-ID: 20060928171947.00933f52.darcy@druid.net (view raw or flat)
Thread:
Lists: pgsql-hackers
On Thu, 28 Sep 2006 22:53:34 +0200
Martijn van Oosterhout <kleptog(at)svana(dot)org> wrote:
> Every new type needs to have a well-defined use-case before it can be
> considered for includion.

Well, it is already included.  The current proposal is simply to
improve the existing type.  I guess you are arguing a different
proposal altogether - to remove the existing type.

> Currently we have:
> - Is possibly faster than numeric

I suppose I should quantify this but it's hard to get motivated after
the many man-hours (mine and my staff) I had to spend on code and
schema optimizations I needed to do just to get closer to the previous
speed our aps had before we converted from money to numeric.  I will
try to find time to put together a test that appoximates that real
world example.

> - Takes less space than numeric

Never really considered this a major improvement over numeric given the
cost of disk these days.  I suppose it could be contributing to the
speed increase.

> - Customisable output (only one currency at a time though)
> - Fixed number of decimal places

The original code actually handled number of decimal places.  It tended
to cause problems though.  These are areas that the existing type, as
well as the proposed change, could be worked on.  I would hesitate to
work on both together though and going to 64bit will probably add more
value right now than those things, certainly for existing users of the
type.

By the way, the current proposal actually removes the currency symbol
but I have received complaints about that.  It should probably go back
just because it is outside of the scope of the primary change.  That
can be dealt with later.

-- 
D'Arcy J.M. Cain <darcy(at)druid(dot)net>         |  Democracy is three wolves
http://www.druid.net/darcy/                |  and a sheep voting on
+1 416 425 1212     (DoD#0082)    (eNTP)   |  what's for dinner.

In response to

Responses

pgsql-hackers by date

Next:From: David FetterDate: 2006-09-28 21:21:19
Subject: Re: [HACKERS] Numeric overflow problem + patch
Previous:From: David FetterDate: 2006-09-28 21:19:10
Subject: Re: [HACKERS] Numeric overflow problem + patch

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group