Re: [INTERFACES] JDBC: BigDecimal and Money confusion
В списке pgsql-interfaces по дате отправления:
| От | Tom Lane |
|---|---|
| Тема | Re: [INTERFACES] JDBC: BigDecimal and Money confusion |
| Дата | |
| Msg-id | 13336.937665011@sss.pgh.pa.us обсуждение |
| Ответ на | JDBC: BigDecimal and Money confusion (Mark Lillywhite <mark@plasticsoftware.com.au>) |
| Список | pgsql-interfaces |
Mark Lillywhite <mark@plasticsoftware.com.au> writes:
> (As an aside, I found the PGMoney class but it too only accepts doubles. I
> could use doubleValue() on the BigDecimal but I am worried about the loss of
> precision given my past experience. So my position is that I reckon I should
> be able to use arbitrary precision up until the database interprets it).
Mark, I dunno what Postgres version you are using, but there is a
genuine arbitrary-precision-decimal NUMERIC type in Postgres 6.5 & up.
That's probably what you should be using. The old 'money' type is a
hack, because it overflows too easily. ($20 million ain't what it
used to be ;-).) It's now deprecated and will probably go away
entirely at some point.
regards, tom lane
В списке pgsql-interfaces по дате отправления:
Сайт использует файлы cookie для корректной работы и повышения удобства. Нажимая кнопку «Принять» или продолжая пользоваться сайтом, вы соглашаетесь на их использование в соответствии с Политикой в отношении обработки cookie ООО «ППГ», в том числе на передачу данных из файлов cookie сторонним статистическим и рекламным службам. Вы можете управлять настройками cookie через параметры вашего браузера