Home > Archive > PostgreSQL JDBC > April 2005 > Re: Interval support for Postgres









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author Re: Interval support for Postgres
Kris Jurka

2005-04-29, 7:25 am



On Fri, 29 Apr 2005, Oliver Siegmar wrote:

> On Friday 29 April 2005 10:01, Kris Jurka wrote:
>
> Sounds reasonable. But I'm not sure if we should support "oversized" values -
> I see no requirement for it, and it adds a lot of possible trouble.


Well the constructor and setXXX methods allow it. I'm not saying we need
to go out of our way to make all excessive values possible, but if we can
allow say 90 seconds with no other harm, why not? If we're going to
prevent it, we should prevent it at set time, not at getValue time.

>
> 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

>
> Why? When is the current implementation doing wrong?
>


final int milliseconds = microseconds / 1000 - seconds * 1000;

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

Kris Jurka

---------------------------(end of broadcast)---------------------------
TIP 8: explain analyze is your friend

Sponsored Links





Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive | Programming forum archive

Copyright 2008 droptable.com