Re: New version of money type

Поиск
Список
Период
Сортировка
От D'Arcy J.M. Cain
Тема Re: New version of money type
Дата
Msg-id 20060915110501.11ae122c.darcy@druid.net
обсуждение исходный текст
Ответ на Re: New version of money type  (AgentM <agentm@themactionfaction.com>)
Список pgsql-hackers
On Thu, 14 Sep 2006 14:12:30 -0400
AgentM <agentm@themactionfaction.com> wrote:
> If you force the locale into the money type, then the entire column  
> must be of the same currency. That seems like an unnecessary  
> limitation. Does your type support banker's rounding?

The whole point of money is to have a high speed type suitable for
accounting apps.  I had an application that used money that we had to
switch to numeric due to the size limitation.  When we did we saw a
dramatic degredation in performance.  The app was a gift card system
that tracked card balances.  A card might have hundreds of transactions
and one client might have millions of cards.  We had to sum all of
those transactions grouped by card.  It would have been great to have
been able to keep the original money type but total sales broke the
limit.

We use rint(), same as the previous version.  I know that that isn't
precisely banker's rounding.  I think that those special rules would
have to be handled in code.  In that environment you would probably
want to do that for auditing (code and otherwise) purposes.

-- 
D'Arcy J.M. Cain <darcy@druid.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-hackers по дате отправления:

Предыдущее
От: "D'Arcy J.M. Cain"
Дата:
Сообщение: Re: New version of money type
Следующее
От: "Albe Laurenz"
Дата:
Сообщение: Re: [PATCHES] Linking on AIX (Was: Fix linking of OpenLDAP libraries )