Re: [HACKERS] Interval aggregate regression failure

From: Bruce Momjian <bruce(at)momjian(dot)us>
To: Michael Glaesemann <grzm(at)seespotcode(dot)net>
Cc: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, Michael Paesold <mpaesold(at)gmx(dot)at>, PostgreSQL-patches <pgsql-patches(at)postgresql(dot)org>
Subject: Re: [HACKERS] Interval aggregate regression failure
Date: 2006-09-04 01:07:21
Message-ID: 200609040107.k8417Lv12481@momjian.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-patches

Michael Glaesemann wrote:
>
> On Sep 4, 2006, at 4:45 , Bruce Momjian wrote:
>
> > Another question. Is this result correct?
> >
> > test=> select '999 months 999 days'::interval / 100;
> > ?column?
> > -------------------------
> > 9 mons 38 days 40:33:36
> > (1 row)
> >
> > Should that be:
> >
> > 9 mons 39 days 16:33:36
>
> Yeah, I think it should be. I had been thinking of treating the month
> and day component as having separate time contributions, but it makes
> more sense to think of month as a collection of days first, integral
> or no, and then cascade down the fractional portion of the combined
> days component to time. I.e., 9.99 mon is 9 mon 29.7 days, rather
> than 9 mon 29 days 60480 sec.

No, I don't think so. If we do that, there is no reason to cascade at
all. Why not just say 9.1 months?

I am going to work on a patch to fix the >24 hours case, which will fix
your 24:00:00 case at the same time. Will post in an hour.

--
Bruce Momjian bruce(at)momjian(dot)us
EnterpriseDB http://www.enterprisedb.com

+ If your life is a hard drive, Christ can be your backup. +

In response to

Browse pgsql-patches by date

  From Date Subject
Next Message Bruce Momjian 2006-09-04 01:07:58 Re: [HACKERS] Interval aggregate regression failure
Previous Message Michael Glaesemann 2006-09-04 00:57:01 Re: Interval month, week -> day