Skip site navigation (1) Skip section navigation (2)

JDBC, Timestamp and getting microseconds

From: Philip Crotwell <crotwell(at)seis(dot)sc(dot)edu>
To: pgsql-interfaces(at)postgresql(dot)org
Cc: Philip Crotwell <crotwell(at)seis(dot)sc(dot)edu>
Subject: JDBC, Timestamp and getting microseconds
Date: 2000-12-08 03:17:06
Message-ID: (view raw, whole thread or download thread mbox)
Lists: pgsql-interfaces

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?



pgsql-interfaces by date

Next:From: Thomas LockhartDate: 2000-12-08 04:36:26
Subject: Re: v7.1 beta 1 ...packaged, finally ...
Previous:From: Joel BurtonDate: 2000-12-08 02:15:21
Subject: Re: v7.1 beta 1 (ODBC driver?)

Privacy Policy | About PostgreSQL
Copyright © 1996-2017 The PostgreSQL Global Development Group