Received: from localhost (postgresql.org [64.49.215.8]) by postgresql.org (Postfix) with ESMTP id 13B9C475ADD; Sun, 26 Jan 2003 08:53:19 -0500 (EST) Received: from druid.net (druid.net [216.126.72.98]) by postgresql.org (Postfix) with ESMTP id 6CED6475AA1; Sun, 26 Jan 2003 08:53:18 -0500 (EST) Received: by druid.net (Postfix, from userid 1000) id 9B7C31C6A; Sun, 26 Jan 2003 08:53:22 -0500 (EST) Content-Type: text/plain; charset="iso-8859-1" From: "D'Arcy J.M. Cain" Reply-To: pgsql-hackers@postgreSQL.org To: josh@agliodbs.com, ddurst@larubber.com, Subject: Re: [SQL] Function for adding Money type Date: Sun, 26 Jan 2003 08:53:21 -0500 User-Agent: KMail/1.4.3 References: <34741.10.1.86.1.1043451677.squirrel@www.la-rubber.com> <200301241617.09544.josh@agliodbs.com> In-Reply-To: <200301241617.09544.josh@agliodbs.com> Cc: pgsql-hackers@postgreSQL.org MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Message-Id: <200301260853.21987.darcy@druid.net> X-Virus-Scanned: by AMaViS new-20020517 X-Archive-Number: 200301/973 X-Sequence-Number: 34583 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 | 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.