Re: [HACKERS] Interval aggregate regression failure

From: Bruce Momjian <bruce(at)momjian(dot)us>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Michael Glaesemann <grzm(at)seespotcode(dot)net>, 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:58
Message-ID: 200609040107.k8417wq12601@momjian.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-patches

Tom Lane wrote:
> Bruce Momjian <bruce(at)momjian(dot)us> writes:
> > Is this non-datetime integer only or both? I cannot reproduce the
> > failure here.
>
> On HPPA with float datetimes with today's code, Michael's case works
> but it took me less than two minutes to find one that doesn't:
>
> regression=# select interval '14 mon' * 8.2 as product_h;
> product_h
> ---------------------------------
> 9 years 6 mons 23 days 24:00:00
> (1 row)
>
> I reiterate my comment that this approach will never work; any small
> amount of experimentation will turn up cases that don't round correctly
> on one platform or another. Float arithmetic is inherently inexact.

Working on a new patch to round; will post.

--
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 Tom Lane 2006-09-04 01:33:58 Re: [HACKERS] Interval month, week -> day
Previous Message Bruce Momjian 2006-09-04 01:07:21 Re: [HACKERS] Interval aggregate regression failure