Skip site navigation (1) Skip section navigation (2)

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: pgsql-hackers(at)postgresql(dot)org, 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-08-31 18:57:41
Message-ID: (view raw, whole thread or download thread mbox)
Lists: pgsql-hackerspgsql-patches
Tom Lane wrote:
> Bruce Momjian <bruce(at)momjian(dot)us> writes:
> > OK, here is a much nicer patch.  The fix is to do no rounding, but to
> > find the number of days before applying the factor adjustment.
> You have forgotten the problem of the factor not being exactly
> representable (eg, things like '10 days' * 0.1 not giving the expected
> result).  Also, as coded this is subject to integer-overflow risks
> that weren't there before.  That could be fixed, but it's still only
> addressing a subset of the problems.  I don't think you can fix them
> all without rounding somewhere.

Well, the patch only multiplies by 30, so the interval would have to
span +5 million years to overflow.  I don't see any reason to add
rounding until we get an actual query that needs it (and because
rounding is arbitrary).  I think the proposed fix is the best we can do
at this time.

  Bruce Momjian   bruce(at)momjian(dot)us

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

In response to


pgsql-hackers by date

Next:From: Tom LaneDate: 2006-08-31 18:58:48
Subject: Re: Prepared statements considered harmful
Previous:From: Jeff DavisDate: 2006-08-31 18:55:44
Subject: Re: Prepared statements considered harmful

pgsql-patches by date

Next:From: Victor B. WagnerDate: 2006-08-31 19:44:00
Subject: Re: [PATCHES] Backend SSL configuration enhancement
Previous:From: Bruce MomjianDate: 2006-08-31 18:48:19
Subject: Re: [HACKERS] [PATCHES] log_statement output for protocol

Privacy Policy | About PostgreSQL
Copyright © 1996-2017 The PostgreSQL Global Development Group