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

Re: [HACKERS] Interval aggregate regression failure (expected seems

From: Michael Glaesemann <grzm(at)seespotcode(dot)net>
To: Bruce Momjian <bruce(at)momjian(dot)us>
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 (expected seems
Date: 2006-08-29 16:22:46
Message-ID: 56E37AA9-048A-422B-AA26-E0A1F09314F0@seespotcode.net (view raw or flat)
Thread:
Lists: pgsql-hackerspgsql-patches
On Aug 30, 2006, at 1:13 , Bruce Momjian wrote:

> Uh, I came up with a cleaner one, I think.  I didn't test
> --enable-integer-datetimes yet.

Cool. It's indeed much cleaner. Thanks, Bruce. I'm about to head to  
bed, but I'll look at it more closely tomorrow.

I also noticed that my regression tests didn't exercise the code I  
thought it did. If you have a chance before I get to it, you might  
want to try these as well:

select interval '41 mon 12 days 360:00' / 10 as quotient_a
     , interval '41 mon -12 days -360:00' / 10 as quotient_b
     , interval '-41 mon 12 days 360:00' / 10 as quotient_c
     , interval '-41 mon -12 days -360:00' / 10 as quotient_d;
        quotient_a       |       quotient_b        |         
quotient_c         |        quotient_d
------------------------+------------------------- 
+---------------------------+---------------------------
4 mons 4 days 40:48:00 | 4 mons 2 days -40:48:00 | -4 mons -2 days  
+40:48:00 | -4 mons -4 days -40:48:00
(1 row)

select interval '41 mon 12 days 360:00' * 0.3 as product_a
     , interval '41 mon -12 days -360:00' * 0.3 as product_b
     , interval '-41 mon 12 days 360:00' * 0.3 as product_c
     , interval '-41 mon -12 days -360:00' * 0.3 as product_d;
         product_a         |          product_b          |           
product_c          |            product_d
--------------------------+----------------------------- 
+-----------------------------+---------------------------------
1 year 12 days 122:24:00 | 1 year 6 days -122:23:60.00 | -1 years -6  
days +122:24:00 | -1 years -12 days -122:23:60.00
(1 row)

The quotients look fine, but I'm wondering if another set of rounding  
is needed to bump those -122:23:60.00 to -122:24:00 in product_b and  
product_d.

Michael Glaesemann
grzm seespotcode net


In response to

Responses

pgsql-hackers by date

Next:From: Stefan KaltenbrunnerDate: 2006-08-29 16:39:23
Subject: Re: stats test on Windows is now failing repeatably?
Previous:From: Bruce MomjianDate: 2006-08-29 16:13:11
Subject: Re: [HACKERS] Interval aggregate regression failure

pgsql-patches by date

Next:From: Alvaro HerreraDate: 2006-08-29 17:15:25
Subject: Re: Updatable views
Previous:From: Bruce MomjianDate: 2006-08-29 16:13:11
Subject: Re: [HACKERS] Interval aggregate regression failure

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