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

Re: BUG in pg backend?

From: Vince Vielhaber <vev(at)michvhf(dot)com>
To: Matt Bernstein <matt(at)gold(dot)ac(dot)uk>
Cc: webmaster(at)postgresql(dot)org, pgsql-bugs(at)postgresql(dot)org
Subject: Re: BUG in pg backend?
Date: 1999-09-22 11:00:37
Message-ID: Pine.BSF.4.05.9909220656430.16695-100000@paprika.michvhf.com (view raw or flat)
Thread:
Lists: pgsql-bugs
On Wed, 22 Sep 1999, Matt Bernstein wrote:

> I tried to submit a bug report online, but the bug page was "not found".
> That's definitely a bug! Please forward the SQL bug below to whoever deals
> with backend bugs.

Fixed and CC'd bugs list.

Vince.

> 
> Cheers,
> 
> Matt
> 
> --8<----8<----8<--
> 
> BUG in AVG() ???
> 
> Observe this (in psql):
> 
> --8<--
> 
> mcsbeta4=> \d cregistrations
> Table    = cregistrations
> +----------------------------------+----------------------------------+-------+
> |              Field               |              Type                |
> Length|
> +----------------------------------+----------------------------------+-------+
> | candno                           | text                             |
> var |
> | student                          | text not null                    |
> var |
> | course                           | text not null                    |
> var |
> | cattempt                         | int2                             |
> 2 |
> | ayear                            | text not null default defaultaye |
> var |
> | cwptoverall                      | numeric                          |  5.2
> |
> | examresult                       | numeric                          |  5.2
> |
> | result                           | numeric                          |  5.2
> |
> | finalresult                      | numeric                          |  5.2
> |
> | resultcode                       | text                             |
> var |
> | progressioncode                  | text                             |
> var |
> +----------------------------------+----------------------------------+-------+
> Index:    cregistrations_pkey
> 
> mcsbeta4=> select AVG(examresult) from cregistrations;
> ERROR:  overflow on numeric ABS(value) >= 10^-1 for field with precision 0
> scale 1723
> mcsbeta4=> select SUM(examresult)/COUNT(examresult) from cregistrations;
>      ?column?
> -------------
> 44.2075493061
> (1 row)
> 
> --8<--
> 
> Why does AVG(examresult) fail where SUM(examresult)/COUNT(examresult)
> succeeds? Bizarre :)
> 
> 

-- 
==========================================================================
Vince Vielhaber -- KA8CSH   email: vev(at)michvhf(dot)com   flame-mail: /dev/null
       # include <std/disclaimers.h>                   TEAM-OS2
        Online Campground Directory    http://www.camping-usa.com
       Online Giftshop Superstore    http://www.cloudninegifts.com
==========================================================================




pgsql-bugs by date

Next:From: Craig DockterDate: 1999-09-26 21:54:46
Subject: 6.5.2 create index bug?
Previous:From: star_maDate: 1999-09-22 06:54:03
Subject: one Questions for postgres6.5.1

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