I need to store exact sums of bigint
columns in a summary table. So I must use data type numeric
for those columns.
Now I am wondering if setting the scale to 0
in this case makes sense (e.g. maybe some performance benefit?)
If so, then how can I set the scale to 0
and still keep the default precision:
- according to the docs the data-type
numeric()
(without explicit precision and scale) supports:up to
131072
digits before the decimal point;up to 16383 digits after the decimal point - But when we explicitly set the precision and scale, the max. allowed value for precision is only
1000
: i.e.1000
digits before the decimal point, right?The maximum allowed precision when explicitly specified in the type declaration is 1000;