JDBC, Timestamp and getting microseconds

Поиск
Список
Период
Сортировка
От Philip Crotwell
Тема JDBC, Timestamp and getting microseconds
Дата
Msg-id Pine.GSO.4.10.10012072146510.3465-100000@tigger.seis.sc.edu
обсуждение исходный текст
Список 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 по дате отправления:

Предыдущее
От: Bruce Momjian
Дата:
Сообщение: Re: [PATCHES] Diff to fix SQLForeignKeys in ODBC
Следующее
От: Peter Mount
Дата:
Сообщение: RE: RE: JDBC Timestamp Problem