Re: Problem with Now()? - Mailing list pgsql-general

From Linn Kubler
Subject Re: Problem with Now()?
Date
Msg-id sd5b8b1f.022@gw1.inet.ecw.org
Whole thread Raw
In response to Problem with Now()?  ("Linn Kubler" <LKubler@ecw.org>)
List pgsql-general
Thanks for the suggestion Tom, I'll enquire with the developer who
developed the system about the JDBC version.

Linn

>>> Tom Lane <tgl@sss.pgh.pa.us> 08/15/02 10:19AM >>>
"Linn Kubler" <LKubler@ecw.org> writes:
> ...  The first record listed has the bad timestamp and the second
> is an older record with what I think is a normal timestamp.

> Hope this helps shed some light on the problem.  This is a problem
for
> me because it is crashing a JAVA application with an ejbexception:
Bad
> Timestamp Format error message.

>  productid |        title        |          datecreated
> -----------+---------------------+-------------------------------
>        428 | Zebra Test Record 1 | 2002-08-15 09:13:33.684448-05
> (1 row)

>  productid |                            title
    |      datecreated
>
-----------+--------------------------------------------------------------+------------------------
>        421 | Tour Guide for the Fond du Lac High School Geothermal
System | 2002-07-01 09:47:29-05
> (1 row)

Okay.  These are both perfectly valid; it's just that in prior
releases,
now() produced a result rounded to the nearest second and so you
rarely
would see any fractional-second timestamps.  As of 7.2 now() gives the
full accuracy of gettimeofday().

I believe that using a more recent release of our JDBC driver would
fix
your problem with the Java code not understanding the fractional
second.
If that's not practical, you can recreate the table with the timestamp
column redeclared as "timestamp(0) with time zone".  That limits the
column precision to 0 fractional digits, so you'll never see any
fractional part.

            regards, tom lane

pgsql-general by date:

Previous
From: "Linn Kubler"
Date:
Subject: Re: Problem with Now()?
Next
From: Markus Wagner
Date:
Subject: Re: how to synchronize database operations?