SUM overflows

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?


  • Options
    This is indeed a bug. I've reported it to our development team. Thanks very much for your report.

Leave a Comment

BoldItalicStrikethroughOrdered listUnordered list
Align leftAlign centerAlign rightToggle HTML viewToggle full pageToggle lights
Drop image/file