Received: from maia.hub.org (unknown [200.46.204.183]) by mail.postgresql.org (Postfix) with ESMTP id 7D42F634067 for ; Tue, 19 Jan 2010 00:38:21 -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 35054-06 for ; Tue, 19 Jan 2010 04:38:11 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from mail.postnewspapers.com.au (202-89-185-120.static.dsl.amnet.net.au [202.89.185.120]) by mail.postgresql.org (Postfix) with ESMTP id B22E16332DF for ; Tue, 19 Jan 2010 00:38:10 -0400 (AST) Received: from localhost (access [127.0.0.1]) by mail.postnewspapers.com.au (Postfix) with ESMTP id 729561E043F; Tue, 19 Jan 2010 12:38:06 +0800 (WST) X-Virus-Scanned: Debian amavisd-new at postnewspapers.com.au Received: from mail.postnewspapers.com.au ([127.0.0.1]) by localhost (access.postnewspapers.com.au [127.0.0.1]) (amavisd-new, port 10024) with LMTP id vimSAyhYyBZq; Tue, 19 Jan 2010 12:38:04 +0800 (WST) Received: from [10.1.1.6] (203-206-118-60.dyn.iinet.net.au [203.206.118.60]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client CN "Craig Ringer", Issuer "POST Certificate Authority" (verified OK)) by mail.postnewspapers.com.au (Postfix) with ESMTPSA id E9EB11E043C; Tue, 19 Jan 2010 12:38:03 +0800 (WST) Message-ID: <4B55371B.40105@postnewspapers.com.au> Date: Tue, 19 Jan 2010 12:37:47 +0800 From: Craig Ringer User-Agent: Mozilla/5.0 (Windows; U; Windows NT 6.0; en-GB; rv:1.9.1.5) Gecko/20091204 Thunderbird/3.0 MIME-Version: 1.0 To: Greg Stark CC: =?UTF-8?B?SmFrdWIgQmVkbsOhxZk=?= , pgsql-jdbc@postgresql.org Subject: Re: Mapping Java BigDecimal References: <4B540B7D.1080306@b2bcentrum.cz> <4B541C40.9040206@postnewspapers.com.au> <407d949e1001180209v39e46a88v6d5a0e5a181a5d84@mail.gmail.com> In-Reply-To: <407d949e1001180209v39e46a88v6d5a0e5a181a5d84@mail.gmail.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=-2.599 tagged_above=-10 required=5 tests=BAYES_00=-2.599 X-Spam-Level: X-Archive-Number: 201001/49 X-Sequence-Number: 20245 On 18/01/2010 6:09 PM, Greg Stark wrote: > On Mon, Jan 18, 2010 at 8:30 AM, Craig Ringer > wrote: >> I don't know whether Oracle or Pg are more "correct" here - you're >> giving Pg "3" so arguably it shouldn't assume "3.00" and should in fact >> return "3". OTOH, you've told it what the scale and precision are for >> the column, and inputs to the column should be presumed to fit that >> scale and precision. >> > In no case does postgres remember the precision of the input text. If > you don't specify a precision on the column it just prints as many as > necessar. That sounds like what you're looking for. Then I'm confused: regress=> create table test (x numeric); CREATE TABLE ^ regress=> insert into test (x) values ('3'); INSERT 0 1 regress=> insert into test (x) values ('3.0'); INSERT 0 1 regress=> insert into test (x) values ('3.00'); INSERT 0 1 regress=> insert into test (x) values ('3.000'); INSERT 0 1 regress=> select * from test; x ------- 3 3.0 3.00 3.000 (4 rows) -- Craig Ringer