pg.ddx.io  pgsql-jdbc@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Kris Jurka <books@ejurka.com>
To: Andrea Aime <aaime@openplans.org>
Cc: pgsql-jdbc@postgresql.org
Subject: Re: Bug while retrieving money data type from db
Date: Fri, 29 Feb 2008 12:09:52 -0500 (EST)
Message-ID: <Pine.BSO.4.64.0802291203510.30735@leary.csoft.net> (raw)
In-Reply-To: <47C415C7.6070200@openplans.org>
References: <47C415C7.6070200@openplans.org>



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




view thread (4+ messages)  latest in thread

Message-ID: <Pine.BSO.4.64.0802291203510.30735@leary.csoft.net>
Permalink:  ../Pine.BSO.4.64.0802291203510.30735@leary.csoft.net/
Also on:    postgresql.org/message-id/Pine.BSO.4.64.0802291203510.30735@leary.csoft.net

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-jdbc@postgresql.org
  Cc: books@ejurka.com, aaime@openplans.org
  Subject: Re: Bug while retrieving money data type from db
  In-Reply-To: <Pine.BSO.4.64.0802291203510.30735@leary.csoft.net>
  References: <47C415C7.6070200@openplans.org> <Pine.BSO.4.64.0802291203510.30735@leary.csoft.net>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox