Re: Timestamp Question - Mailing list pgsql-jdbc

From Oliver Jowett
Subject Re: Timestamp Question
Date
Msg-id 40F1D5D8.2000205@opencloud.com
Whole thread Raw
In response to Re: Timestamp Question  ("Dario V. Fassi" <software@sistemat.com.ar>)
Responses Re: Timestamp Question
List pgsql-jdbc
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

pgsql-jdbc by date:

Previous
From: Oliver Jowett
Date:
Subject: Re: Timestamp Question
Next
From: Greg Markham
Date:
Subject: Re: Timestamp Question