Skip to main content

SUM overflows

  • July 3, 2013
  • 1 reply
  • 4 views

Kris_Peeters
Forum|alt.badge.img+1
When using SUM() on a large table (1 billion rows), it overflows without warning me: dbadmin=> select SUM(sales) from schema.fact_table; SUM ----------------------- -8083921422909.855574 (1 row) dbadmin=> select SUM(CAST(sales as NUMERIC(30,8))) from schema.fact_table; SUM ------------------------- 10362822650799.69604200 (1 row) dbadmin=> The documentation says SUM should throw an error if that happens. Is this a bug? Or am I missing something?

1 reply

Forum|alt.badge.img+2
  • Participating Frequently
  • July 3, 2013
This is indeed a bug. I've reported it to our development team. Thanks very much for your report.