Received: from maia.hub.org (unknown [200.46.204.183]) by mail.postgresql.org (Postfix) with ESMTP id B1792632281 for ; Mon, 18 Jan 2010 05:26:06 -0400 (AST) Received: from mail.postgresql.org ([200.46.204.86]) by maia.hub.org (mx1.hub.org [200.46.204.183]) (amavisd-maia, port 10024) with ESMTP id 49777-09 for ; Mon, 18 Jan 2010 09:25:56 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from mail.b2bcentrum.cz (dns.b2bcentrum.cz [62.77.97.39]) by mail.postgresql.org (Postfix) with ESMTP id 2998A632308 for ; Mon, 18 Jan 2010 05:25:56 -0400 (AST) Received: from localhost (dns [127.0.0.1]) by mail.b2bcentrum.cz (Postfix) with ESMTP id 153E41850002; Mon, 18 Jan 2010 10:25:54 +0100 (CET) X-Virus-Scanned: amavisd-new at b2bcentrum.cz Received: from mail.b2bcentrum.cz ([127.0.0.1]) by localhost (dns.b2bcentrum.cz [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id ZPBkLcLtVX-6; Mon, 18 Jan 2010 10:25:52 +0100 (CET) Received: from [192.168.1.77] (unknown [77.242.93.97]) (Authenticated sender: bednar) by mail.b2bcentrum.cz (Postfix) with ESMTP id 899FD1850001; Mon, 18 Jan 2010 10:25:52 +0100 (CET) Message-ID: <4B542920.6070600@b2bcentrum.cz> Date: Mon, 18 Jan 2010 10:25:52 +0100 From: =?UTF-8?B?SmFrdWIgQmVkbsOhxZk=?= User-Agent: Thunderbird 2.0.0.23 (X11/20090817) MIME-Version: 1.0 To: John R Pierce CC: pgsql-jdbc@postgresql.org Subject: Re: Mapping Java BigDecimal References: <4B540B7D.1080306@b2bcentrum.cz> <4B5425B0.5040209@hogranch.com> In-Reply-To: <4B5425B0.5040209@hogranch.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=-0.185 tagged_above=-10 required=5 tests=BAYES_40=-0.185 X-Spam-Level: X-Archive-Number: 201001/43 X-Sequence-Number: 20239 John R Pierce wrote: > Jakub Bednář wrote: >> Hi All, >> >> We decide add support PostgreSQL database (now supporting only Oracle >> database) to our product. >> >> In Oracle we mapping Java BigDecimal to number(19, 2), in PostgreSQL >> to numeric(19, 2). >> >> If I store to "BigDecimal column" number without decimal, e.g. "3", >> than Oracle JDBC driver return "3", but PostgreSQL JDBC driver return >> "3.00". > > does a java BigDecimal number have a fixed 2 digit fraction precision > like that? If not, why not just define it as NUMERIC and let the > fractional part 'float' as assigned. ? > > > > No. Two digit fraction was example. I'll fix it by using map BigDecimal to numeric without specify precision and scale.