Re: Bug while retrieving money data type from db

From: Kris Jurka <books(at)ejurka(dot)com>
To: Andrea Aime <aaime(at)openplans(dot)org>
Cc: pgsql-jdbc(at)postgresql(dot)org
Subject: Re: Bug while retrieving money data type from db
Date: 2008-02-29 17:09:52
Message-ID: Pine.BSO.4.64.0802291203510.30735@leary.csoft.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-jdbc

On Tue, 26 Feb 2008, Andrea Aime wrote:

> I've stumbled into a bug, it seems the driver is not able to
> retrive money data type from the db properly unless a getString
> is used.... unfortunately in my case the code does not know
> what kind of attributes is reading, and it uses getObject instead,
> getting back an exception.

We already knew the support for money in the driver was pretty poor (it
doesn't work for locale's whose currency symbol is not $), but the fact
that it doesn't support separators makes it especially useless.
Since every getInt/Float/... call is paying a performance price for
checking for the money type and doesn't always work, I suggest we rip all
that out and return money as either a String or the PGmoney type.

That will break existing applications that want to be able to do getDouble
on money data, but I'm OK with that because they should be pretty rare.

Kris Jurka

In response to

Responses

Browse pgsql-jdbc by date

  From Date Subject
Next Message dmp 2008-02-29 17:32:15 Re: Array Char/VarChar Size
Previous Message Kris Jurka 2008-02-29 16:59:17 Re: Array Char/VarChar Size