# Postgres error 22003: integer out of range / numeric field overflow

> A number does not fit the column or expression type.

Source: https://scribase.com/postgres-errors/22003

SQLSTATE class: Data Exception. Over PostgREST/supabase-js this maps to HTTP 400.

## Causes

- A value above 2147483647 in an integer column, often an id or a counter that outgrew int4.
- Arithmetic on two integers that overflows before it is cast to a bigger type.
- A numeric(p, s) column whose precision is too small for the value.

## Fixes

- Move ids and counters to bigint (alter column ... type bigint; this rewrites the table, so plan it for a quiet time on big tables).
- Cast before multiplying: a::bigint * b.
- Widen numeric precision.