Postgresql JDBC Timestamp problem

From: Veit Guna <Veit(dot)Guna(at)xionet(dot)de>
To: pgsql-bugs(at)postgresql(dot)org
Subject: Postgresql JDBC Timestamp problem
Date: 2002-05-03 15:14:26
Message-ID: 3CD2A952.2000604@xionet.de
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

Hi.

We're using a Postgresql 7.2 Database through the appropriate jdbc
driver with Java 2.

Selecting Data, updating etc. works fine except for the getTimestamp()
method on the ResultSet. It delivers only a 3 digit fraction, although
there's a 6 digit fraction stored in the db (timestamptz column, filled
by now()). The following sequence will consquential fail:

- select timestamp as ts, data from table
- update table set data = 'new data' where timestamp = ts

using PreparedStatements.

We took a look at the JDBC2 implementation of this method. It says
something about java could not store more than a 3 digit fraction.
That's not entirely true. We used the HEAD version of the jdbc driver
from your repository to create a "workaround" that could fix this
problem. Please take a look at the attached ResultSet patch which will
allow a 6 digit fraction. Take this patch only as an idea how the
problem could be solved. It works so far...

Thank you for your patience...

ps.: if this fix will be published, please mention that Stefan Jantzon
has developed this fix mainly 8)...
--
"...$HOME is where cd takes you..."

Attachment Content-Type Size
ResultSet_Timestamp.patch text/plain 4.3 KB

Browse pgsql-bugs by date

  From Date Subject
Next Message Tom Lane 2002-05-03 15:29:55 Re: Strange Behavior when calling a C function by a plpgsql stored prcedure
Previous Message Alban Médici 2002-05-03 14:57:07 Strange Behavior when calling a C function by a plpgsql stored prcedure