Re: Money data type in PostgreSQL?

From: David Garamond <lists(at)zara(dot)6(dot)isreserved(dot)com>
To: Oliver Elphick <olly(at)lfix(dot)co(dot)uk>
Cc: PostgreSQL general list <pgsql-general(at)postgresql(dot)org>
Subject: Re: Money data type in PostgreSQL?
Date: 2003-12-03 08:27:14
Message-ID: 3FCD9E62.20702@zara.6.isreserved.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Oliver Elphick wrote:
>
> You should not regard amounts in different currencies as equivalent.
> You cannot add Euros to dollars and get a meaningful figure; so they
> should not be in the same column.

I plan to store amount in a column (NUMERIC) and currency id in another
(CHAR(3)). Plus another column for amount in 'standard' currency (e.g.
USD; all addition/sum will be done to this column).

> You should only use NUMERIC for money; any kind of floating point
> representation will lose detail somewhere along the line. (I suppose
> you could use BIGINT for Japanese Yen.)

--
dave

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Alvar Freude 2003-12-03 08:33:37 Cast text to bytea
Previous Message Oliver Elphick 2003-12-03 08:08:54 Re: Money data type in PostgreSQL?