SQLSTATE 22015Severity lowLab verified

Incident brief

Interval field overflow

An INTERVAL literal whose field value exceeds the storage limits of the interval type raises this data exception; here a months value larger than a signed 32-bit integer overflowed.

Reproduced on PostgreSQL 18.4Verified 2026-07-24 (isolated lab, PostgreSQL 18.4)Reviewed by Verified against PostgreSQL 18.4 in an isolated lab environment

In 10 seconds

What
Interval field overflow
What triggers it
Write an INTERVAL literal with a field value larger than the type can store (for example billions of months).
The fix
Use interval field values within range — the months field fits in a signed 32-bit integer.
Proof
Reproduced on PostgreSQL 18.4 → A single SELECT reproduces SQLSTATE 22015; the oversized months field is rejected while the literal is evaluated.

The fix

What to do right now

The immediate, application-level response to this error.

  • Use interval field values within range — the months field fits in a signed 32-bit integer.
  • For very long spans, model them differently (a start date plus a smaller interval, or a numeric day count).
Fix — SQL
-- Use an interval field value within the type's range.
SELECT INTERVAL '1 month';

Related & next steps

Follow the thread

Everything this error touches — jump straight to the sibling error, term, runbook, or parameter.

Verification

PG 18.4
Last verified
2026-07-24 (isolated lab, PostgreSQL 18.4)
Reviewed by
Verified against PostgreSQL 18.4 in an isolated lab environment
Audit status
reviewed