From: Oliver Siegmar <o.siegmar@vitrado.de>
To: Kris Jurka <books@ejurka.com>
Cc: pgsql-jdbc@postgresql.org
Subject: Re: Interval support for Postgres
Date: Fri, 29 Apr 2005 17:38:15 +0200
Message-ID: <200504291738.16354.o.siegmar@vitrado.de> (raw)
In-Reply-To: <Pine.BSO.4.56.0504290528500.30933@leary.csoft.net>
References: <200504211107.01028.o.siegmar@vitrado.de>
<200504291225.08799.o.siegmar@vitrado.de>
<Pine.BSO.4.56.0504290528500.30933@leary.csoft.net>
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
Attachments:
pgjdbc_interval5.diff.gz (application/x-gzip, 4.1K) download
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-jdbc@postgresql.org
Cc: o.siegmar@vitrado.de, books@ejurka.com
Subject: Re: Interval support for Postgres
In-Reply-To: <200504291738.16354.o.siegmar@vitrado.de>
References: <200504211107.01028.o.siegmar@vitrado.de> <200504291225.08799.o.siegmar@vitrado.de> <Pine.BSO.4.56.0504290528500.30933@leary.csoft.net> <200504291738.16354.o.siegmar@vitrado.de>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox