22008
Read PG 18 manual ↗datetime_field_overflow
- SQLSTATE
- 22008
- Condition name
- datetime_field_overflow
- Class
- Data Exception
- Source macro
- ERRCODE_DATETIME_FIELD_OVERFLOW
- Evidence
- Source path confirmed
English SQLSTATE atlas: authored explanations and source/runtime evidence are separate from the manual definitions. View source ↗
At a glance
22008 is datetime_field_overflow. Fixed date.c paths report out-of-range date values, date fields, and time fields; the exact message identifies which conversion or operation failed.
Meaning
22008 is datetime_field_overflow. The confirmed date.c paths cover date input and binary receive, make_date field/range validation, and make_time field validation. Date-to-timestamp and arithmetic paths can have their own range messages; inspect the complete primary before choosing a repair.
Messages
The confirmed guards raise ERROR with primary templates date out of range, date out of range: %d-%02d-%02d, and time field value out of range: %d:%02d:%02g. These cited groups have no separate DETAIL or HINT. This page is source-only; no natural runtime observation is claimed.
Diagnosis
Preserve the field values, target datetime type, and whether the operation parsed a date or performed arithmetic. Do not confuse this with 22007 format syntax.
Response
Correct the date fields or choose a representable finite range. If the complete message names a timestamp conversion or infinity arithmetic, change that operation explicitly. This is an ERROR: in an explicit transaction, roll back the transaction or roll back to a savepoint established before the failing conversion before continuing. Re-run only after the input or operation is fixed. No runtime case was run for this page.
Versions
The locked catalogue records this condition from 7.4 in the listed formal snapshots and 19beta3; fixed source coverage is PostgreSQL 18.6.
Sources
See the fixed source links and scope limits in the structured evidence record.
Source evidence
Evidence belongs to the frozen source and runtime versions listed here. It is not a runtime verification of the selected manual version.
22008 is datetime_field_overflow in SQLSTATE Class 22.
Method: Read fixed definition.
The date input/binary receive and field validation paths use 22008 for an unrepresentable date or field; the primary wording identifies whether the failure is a field or range check.
Method: Read date.c range guards.
Limits: This page does not claim every timestamp or interval overflow uses the same message.
The make_time path uses the same condition for an out-of-range time field.
Method: Read the time-field guard.
Limits: Inspect the named target type and operation before choosing a repair.
The locked catalogue records 22008 from 7.4 without proving an exact implementation introduction date.
Method: Use catalogue boundary.
- src/backend/utils/errcodes.txt · REL_18_6 ·
724edf9bde9d356724ad384a2e196edc3c9f80f7 raw/calls/REL_18_6.jsonl· ·- src/backend/utils/adt/date.c · REL_18_6 ·
724edf9bde9d356724ad384a2e196edc3c9f80f7 - src/backend/utils/adt/date.c · REL_18_6 ·
724edf9bde9d356724ad384a2e196edc3c9f80f7 - src/backend/utils/adt/date.c · REL_18_6 ·
724edf9bde9d356724ad384a2e196edc3c9f80f7
Message templates
ERROR · message.date-range
Primary
date out of range
ERROR · message.date-field
Primary
date field value out of range: %d-%02d-%02d
ERROR · message.time-field
Primary
time field value out of range: %d:%02d:%02g
Reproduction & repair cases
No reproduction case is attached to this condition.
Recorded runtime evidence
No runtime observation is attached to this entry.
Definition snapshot: english-manuals:30491c5f1c23786058d4f254875… · English manual source