Re: [INTERFACES] JDBC: BigDecimal and Money confusion
| От | Mark Lillywhite |
|---|---|
| Тема | Re: [INTERFACES] JDBC: BigDecimal and Money confusion |
| Дата | |
| Msg-id | 37E45D0F.C383CF2@plasticsoftware.com.au обсуждение исходный текст |
| Ответ на | Re: [INTERFACES] JDBC: BigDecimal and Money confusion (Tom Lane <tgl@sss.pgh.pa.us>) |
| Список | pgsql-interfaces |
Hi Tom, > 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. Thanks HEAPS for this, we were very confused about the numeric support because we were reading the documentation which indicated that there *was* a numeric type, but we were using the Postgres that comes on the RH6.0 CD, which is 6.4, and of course we couldn't get it to work - but "money" worked fine. We upgraded to 6.5 but we didn't try the numeric type. It's all just 'cos I'm new and don't know my way around the documentation/changelogs/readmes etc yet. Thanks again for your help, I guess my JDBC patch is kinda worthless then :) Cheers Mark
В списке pgsql-interfaces по дате отправления: