X-Original-To: pgsql-jdbc-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.144]) by svr1.postgresql.org (Postfix) with ESMTP id 7E763D1B173 for ; Sun, 11 Jul 2004 21:06:32 -0300 (ADT) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 23077-01 for ; Mon, 12 Jul 2004 00:06:30 +0000 (GMT) Received: from yass.opencloud.co.nz (yass.opencloud.co.nz [203.79.85.162]) by svr1.postgresql.org (Postfix) with ESMTP id 3CDDFD1B18C for ; Sun, 11 Jul 2004 21:06:26 -0300 (ADT) Received: from 203-79-104-60.cable.paradise.net.nz ([203.79.104.60] helo=opencloud.com) by yass.opencloud.co.nz with asmtp (Exim 3.35 #1 (Debian)) id 1BjoKp-0002HR-00; Mon, 12 Jul 2004 12:06:19 +1200 Message-ID: <40F1D5D8.2000205@opencloud.com> Date: Mon, 12 Jul 2004 12:05:44 +1200 From: Oliver Jowett User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.6b) Gecko/20031205 Thunderbird/0.4 X-Accept-Language: en-us, en MIME-Version: 1.0 To: "Dario V. Fassi" Cc: pg@fastcrypt.com, Greg Markham , "pgsql-jdbc@postgresql.org" Subject: Re: Timestamp Question References: <40F012E4.3000001@markhamdirect.com> <40F02556.1070109@sistemat.com.ar> <1089552466.11544.311.camel@localhost.localdomain> <40F19294.8090700@sistemat.com.ar> In-Reply-To: <40F19294.8090700@sistemat.com.ar> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0.1 tagged_above=0.0 required=5.0 tests=RCVD_IN_SORBS X-Spam-Level: X-Archive-Number: 200407/101 X-Sequence-Number: 10485 Dario V. Fassi wrote: > I say that would help a lot if the microseconds part of a timestamp will > be zero padded to a minimum length of 5 or 6 digits. > > Like: > > "then most databases can take 2004-07-10 12:59:59.123 as 2004-07-10 > 12:59:59.123000 " > > This behavior help is cross (vendor) database operations . Isn't this done by the driver already when dealing with a java.sql.Timestamp? Do you have a testcase that shows the problem? The server itself seems to already handle zero-padding just fine: > test=> select '2004-07-10 12:59:59.000123'::timestamp(6); > timestamp > ---------------------------- > 2004-07-10 12:59:59.000123 > (1 row) > > test=> select '2004-07-10 12:59:59.123'::timestamp(6); > timestamp > ------------------------- > 2004-07-10 12:59:59.123 > (1 row) > > > test=> select '2004-07-10 12:59:59.123000'::timestamp(6); > timestamp > ------------------------- > 2004-07-10 12:59:59.123 > (1 row) -O