Re: Money data type in PostgreSQL?

Поиск
Список
Период
Сортировка
От David Garamond
Тема Re: Money data type in PostgreSQL?
Дата
Msg-id 3FCD9E62.20702@zara.6.isreserved.com
обсуждение исходный текст
Ответ на Re: Money data type in PostgreSQL?  (Oliver Elphick <olly@lfix.co.uk>)
Список 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



В списке pgsql-general по дате отправления:

Предыдущее
От: Oliver Elphick
Дата:
Сообщение: Re: Money data type in PostgreSQL?
Следующее
От: Alvar Freude
Дата:
Сообщение: Cast text to bytea