Re: Problem with Now()?

From: "Linn Kubler" <LKubler(at)ecw(dot)org>
To: < <pgsql-general(at)postgresql(dot)org>>
Subject: Re: Problem with Now()?
Date: 2002-08-15 16:05:35
Message-ID: sd5b8b1f.022@gw1.inet.ecw.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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(at)sss(dot)pgh(dot)pa(dot)us> 08/15/02 10:19AM >>>
"Linn Kubler" <LKubler(at)ecw(dot)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

Browse pgsql-general by date

  From Date Subject
Next Message Markus Wagner 2002-08-15 16:39:40 Re: how to synchronize database operations?
Previous Message Linn Kubler 2002-08-15 16:04:05 Re: Problem with Now()?