Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Redshift error Overflow for NUMERIC(8,4)

Why do I get "Overflow for NUMERIC(8,4)" for 10595.148?

like image 656
BPm Avatar asked Nov 07 '15 07:11

BPm


1 Answers

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.

like image 50
Glorfindel Avatar answered Oct 07 '22 21:10

Glorfindel