Received: from localhost (unknown [200.46.204.184]) by postgresql.org (Postfix) with ESMTP id E8BC72E0090 for ; Fri, 29 Feb 2008 13:10:01 -0400 (AST) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.184]) (amavisd-maia, port 10024) with ESMTP id 92296-03 for ; Fri, 29 Feb 2008 13:09:53 -0400 (AST) X-Greylist: from auto-whitelisted by SQLgrey-1.7.5 Received: from mail63.csoft.net (leary.csoft.net [205.205.214.5]) by postgresql.org (Postfix) with SMTP id E2D042E0098 for ; Fri, 29 Feb 2008 13:09:53 -0400 (AST) Received: (qmail 30396 invoked by uid 1112); 29 Feb 2008 17:09:52 -0000 Date: Fri, 29 Feb 2008 12:09:52 -0500 (EST) From: Kris Jurka X-X-Sender: books@leary.csoft.net To: Andrea Aime cc: pgsql-jdbc@postgresql.org Subject: Re: Bug while retrieving money data type from db In-Reply-To: <47C415C7.6070200@openplans.org> Message-ID: References: <47C415C7.6070200@openplans.org> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200802/203 X-Sequence-Number: 18410 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