PostgreSQL: how to resolve "numeric field overflow" problem

It looks like you have your year and week_of_month columns defined as numeric(17,17), which means 17 digits, 17 of which are behind the decimal point. So the value has to be between 0 and 1. You probably meant numeric(17,0), or perhaps you should use an integer type.


I had a similar problem even without having set an upper limit. If this happens to you, you might want to look at the global PostgreSQL limits here: https://www.postgresql.org/docs/9.6/static/datatype-numeric.html

For instance TIMESTAMP are a kind of BIGINT with a limit of 9223372036854775807 so you might want to validate that the integer your are passing in your query is below that value.

Tags:

Postgresql