Re: Interval support for Postgres

Поиск
Список
Период
Сортировка
От Oliver Siegmar
Тема Re: Interval support for Postgres
Дата
Msg-id 200504291738.16354.o.siegmar@vitrado.de
обсуждение исходный текст
Ответ на Re: Interval support for Postgres  (Kris Jurka <books@ejurka.com>)
Ответы Re: Interval support for Postgres
Список pgsql-jdbc
Hi Kris,

On Friday 29 April 2005 12:35, Kris Jurka wrote:
> > > My one remaining question is about the roll function.  What is the
> > > purpose of roll, don't we want add?
> >
> > a) because the database doesn't return "oversized" values - so it doesn't
> > matter using add() or roll()
>
> Surely it does, consider a calendar 2001-01-01 00:00:45 and an interval of
> 20 seconds.  roll gives 2001-01-01 00:00:05 while add gives the
> correct 2001-01-01 00:01:05

Oh...I must have goofed. You're right - I tried to implement a working add()
version.

In the initial implementation of add() (a never sent implementation) I was too
demanding. It is just not possible to "roll" every date forth and back and
get the initial date, of course. Just think of Mar 31 plus one month and then
one month back...that cannot be Mar 31 and that's okay. This has to be
considered when testing - not any starting date can be used to roll forth and
back.

> Shouldn't this be "microseconds + 500 / 1000" (although it does need to
> account for the sign.

Yeah, good point - applied that, too.


Give pgjdbc_interval5.diff a new try ;-)


Oliver

Вложения

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

Предыдущее
От: David Gagnon
Дата:
Сообщение: help .. calling VACUUM FULL ANALYSE via JDBC make my production server restarting ?!?!?!? Please help :-(
Следующее
От: Kris Jurka
Дата:
Сообщение: Re: Interval support for Postgres