JDBC, Timestamp and getting microseconds - Mailing list pgsql-interfaces

From Philip Crotwell
Subject JDBC, Timestamp and getting microseconds
Date
Msg-id Pine.GSO.4.10.10012072146510.3465-100000@tigger.seis.sc.edu
Whole thread Raw
List pgsql-interfaces
Hi

I have an application storing seismology data that needs to store
Timestamps (or something similar) with at least tenth of millisecond
precision. The docs for postgres 7.0 say that Timestamp has "1 microsec /
14 digits" resolution, and the JDBC Timestamp has room for nanoseconds, so
I thought I was fine.

But from looking at the jdbc ResultSet code, it seems that everything is
chopped off at hundredths of a second??? I also looked into the code for
ResultSet.getTIme, thinking that I could store the date and time
separately, but it seems to chop it off at even seconds.

I have played a little bit with datestyle and psql and I suspect that this
may not directly be a jdbc problem as they seem to chop at hundredths as
well. So, is there any way to get a higher precision Timestamp (or
equivalent) in and out of postgres with jdbc without loosing resolution or
resorting to putting in my own format (maybe long micros since 1970)?

And what does 1 microsec / 14 digits mean?

thanks,
Philip



pgsql-interfaces by date:

Previous
From: Bruce Momjian
Date:
Subject: Re: [PATCHES] Diff to fix SQLForeignKeys in ODBC
Next
From: Peter Mount
Date:
Subject: RE: RE: JDBC Timestamp Problem