Re: work in progress: timestamp patch

Поиск
Список
Период
Сортировка
От Christian Cryder
Тема Re: work in progress: timestamp patch
Дата
Msg-id 90876a9e05072612478f36c41@mail.gmail.com
обсуждение исходный текст
Ответ на Re: work in progress: timestamp patch  (Dave Cramer <pg@fastcrypt.com>)
Список pgsql-jdbc
On 7/25/05, Dave Cramer <pg@fastcrypt.com> wrote:
> One of the times he is trying to stick in the db is a non-existant
> time if it is associated with a time zone
>
> stmt.execute("INSERT INTO Foo (t1) VALUES ('2005-04-03 02:29:43.0')");
>
> in any US timezone this time does not exist. In US/Mountain timezone
> this inserts as  2005-04-03 03:29:43.0' note the hour has incremented from
> 2 to 3

Just a clarification guys.
a) this time is only invalid in a US timezone that uses Daylight Savings
b) if you insert it via Statement like this, it inserts into the db
just fine; if you insert it using PreparedStatement the value will get
munged
c) once you have the value in the DB, the question is: "How can I read
the value and then rewrite it without munging it"

The only answer to c right now is
a) reconfigure both your client and your server to run in UTC (or some
other non-DST zone)
b) reconfigure your client to turn DST off, and then adjust the server
zone programatically just for the scope of the connection (that was
what my little patch was about)

Neither of these solutions is particularly appealing. I'm surprised
the basic data-integrity aspects of this issue don't bother people
more...

Christian

В списке pgsql-jdbc по дате отправления:

Предыдущее
От: Christian Cryder
Дата:
Сообщение: Re: Timestamp Summary
Следующее
От: Scott Goldstein
Дата:
Сообщение: Client Connection vs. JDBC Connections vs. Postgres processes