Re: Function for adding Money type - Mailing list pgsql-sql

From D'Arcy J.M. Cain
Subject Re: Function for adding Money type
Date
Msg-id 200301260853.21987.darcy@druid.net
Whole thread Raw
In response to Re: Function for adding Money type  (Josh Berkus <josh@agliodbs.com>)
Responses Re: Function for adding Money type  (Thomas Good <tomg@sqlclinic.net>)
Re: Function for adding Money type  (Oliver Elphick <olly@lfix.co.uk>)
List pgsql-sql
On Friday 24 January 2003 19:17, Josh Berkus wrote:
> The MONEY type is depreciated, and should have been removed from the
> Postgres source but was missed as an oversight.   Use NUMERIC instead.

Note that not all of us agree.  I had to change all of our fields from MONEY 
to NUMERIC recently because of the lack of support for MONEY but I would 
prefer to see it improved instead.  Now that we have changed we find that we 
need to create a new table for balances driven by a trigger because 
calculating balances just went up in cost with that change.  The reason is 
simply that MONEY used nothing but integer arithmetic and NUMERIC has to do a 
lot more processing in code.

This year, my team is planning on improving the MONEY type.  Of course, we can 
always make it a user defined type if PostgreSQL doesn't want it.  We will at 
least put it into contrib.  However, if people think that it is useful and 
want to leave it in the main tree that's good too.  What we want to do is a) 
switch to a 64 bit integer from a 32 bit integer in order to hold amounts of 
any reasonabe size and b) allow it to be cast to and from more types.  
Perhaps we can also add the ability to specify the number of decimal places 
on output but I am not sure if that would affect the primary benefit of using 
it, speed.

-- 
D'Arcy J.M. Cain <darcy@{druid|vex}.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.


pgsql-sql by date:

Previous
From: "David Durst"
Date:
Subject: Re: ERROR: Cannot display a value of type RECORD
Next
From: Thomas Good
Date:
Subject: Re: Function for adding Money type