Re: [HACKERS] Interval aggregate regression failure - Mailing list pgsql-patches

From Bruce Momjian
Subject Re: [HACKERS] Interval aggregate regression failure
Date
Msg-id 200609031945.k83JjLK14951@momjian.us
Whole thread Raw
In response to Re: [HACKERS] Interval aggregate regression failure (expected seems  (Michael Glaesemann <grzm@seespotcode.net>)
Responses Re: [HACKERS] Interval aggregate regression failure (expected seems
Re: [HACKERS] Interval aggregate regression failure
List pgsql-patches
Michael Glaesemann wrote:
>
> On Sep 3, 2006, at 12:34 , Bruce Momjian wrote:
>
> > OK, I worked with Michael and I think this is the best we are going to
> > do to fix this.  It has one TSROUND call for Powerpc, and that is
> > documented.  Applied.
>
> As I was working up regression tests, I found a case that this patch
> doesn't handle.
>
> select interval '4 mon' * .3 as product_h;
>         product_h
> -----------------------
> 1 mon 5 days 24:00:00
> (1 row)
>
> This should be 1 mon 6 days. It fails for any number of months
> greater than 3 that is not evenly divisible by 10, greater than 3
> months. Do we need to look at the month remainder separately?

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

The core problem is that the combined remainder seconds of months and
days is > 24 hours.

--
  Bruce Momjian   bruce@momjian.us
  EnterpriseDB    http://www.enterprisedb.com

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

pgsql-patches by date:

Previous
From: Tom Lane
Date:
Subject: Re: [HACKERS] Interval aggregate regression failure (expected seems
Next
From: Gregory Stark
Date:
Subject: Re: Concurrent connections in psql patch