Reputation: 2994
Why do I get "Overflow for NUMERIC(8,4)" for 10595.148?
Upvotes: 6
Views: 20247
Reputation: 22631
Redshift is based on PostgreSQL, so it follows the PostgreSQL rules for numeric data types.
NUMERIC(8,4)
indicates a scale of 4, so it will try to store your number with 4 decimal digits in the fraction part: 10595.1480
. This number has 9 digits, which is higher than the precision of 8. The maximum number you can store in this data type is 9999.9999
.
Upvotes: 13