Re: Strange behavior after setting timestamp field to null - A bug?

From: "Kevin Grittner" <Kevin(dot)Grittner(at)wicourts(dot)gov>
To: "Martti Jeenicke" <martti(dot)jeenicke(at)coremedia(dot)com>, <pgsql-jdbc(at)postgresql(dot)org>
Subject: Re: Strange behavior after setting timestamp field to null - A bug?
Date: 2010-02-08 19:04:40
Message-ID: 4B700BE8020000250002F0A3@gw.wicourts.gov
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-jdbc

"Jeenicke, Martti" <martti(dot)jeenicke(at)coremedia(dot)com> wrote:

> The different lines are results of querying the timestamp field
> after different set and setNull operations. Note that the last
> line shows that the timestamp is stored incorrectly even though
> the timestamp and timezone does not change in the test.

Confirmed. Your program gave me this:

Feb 8, 2010 6:49:21 PM
Feb 8, 2010 6:49:21 PM
Feb 8, 2010 6:49:21 PM
Feb 8, 2010 12:49:21 PM

and psql shows this afterward:

mydatabase=# select * from mje.tab1 ;
id | testdate
----+-------------------------
1 | 2010-02-08 18:49:21.784
2 |
3 | 2010-02-08 18:49:21.784
4 | 2010-02-08 18:49:21.784
5 |
6 | 2010-02-08 12:49:21.784
(6 rows)

The first three are correct for current GMT. The last is local time
here. I tried closing out the result set properly by adding these
line to the end of the selectValue method, with no change in
results.

resultSet.next();
resultSet.close();

I was also confused by the result of changing the column to
TIMESTAMP WITH TIME ZONE -- all timestamps were the same, but they
were two hours later than local time and four hours earlier than
GMT!?!

This was on kubuntu with Java 1.6.0_17.

-Kevin

In response to

Responses

Browse pgsql-jdbc by date

  From Date Subject
Next Message Kevin Grittner 2010-02-08 19:12:55 Re: Strange behavior after setting timestamp field to null - A bug?
Previous Message Jeenicke, Martti 2010-02-08 17:06:39 Strange behavior after setting timestamp field to null - A bug?