54000 — program_limit_exceeded
54000
At a glance
54000 is used when a concrete program, representation, or extension limit is exceeded. Fixed examples include safe allocation-size arithmetic, relation block numbering, array dimensions/size, cube dimensions, and hstore pair counts; the source path identifies the limit.
| Field | Value |
|---|---|
| SQLSTATE | 54000 |
| Condition | program_limit_exceeded |
| Status | active |
| Known present by | 7.4 |
| Locked snapshots | 9.0.23, 9.1.24, 9.2.24, 9.3.25, 9.4.26, 9.5.25, 9.6.24, 10.23, 11.22, 12.22, 13.23, 14.24, 15.19, 16.15, 17.11, 18.6, 19beta3 |
| Macros | ERRCODE_PROGRAM_LIMIT_EXCEEDED |
| Aliases | — |
Meaning
The condition is not a general “large value” warning. Core mcxt.c checks addition and multiplication of allocation sizes and emits invalid memory allocation request size ... on overflow; relation storage refuses a block number at InvalidBlockNumber; array construction/subscripts enforce dimension and total-size limits. Extension paths add their own ceilings: cube reports that a cube cannot have more than %d dimensions, while hstore reports actual and maximum pair counts. The operation and source path define the limit.
Diagnosis
Identify the source component and reported actual/maximum values. Check whether this is allocation-size overflow, relation growth, array dimensions/size, cube dimensions, hstore pairs, or another component. Inspect the expression or generated value that expands the request; an allocation-size overflow is a request-arithmetic problem, not proof that the host is out of RAM.
Response
Reduce the requested size, dimension, block growth, or pair count; split the value or choose a representation whose documented limit fits the requirement. For relation limits, redesign or partition storage before retrying. If an ERROR occurs inside an explicit transaction, use ROLLBACK or ROLLBACK TO SAVEPOINT before retrying; in autocommit, retry only after the request fits the named program limit. Do not discard elements silently or “fix” arithmetic overflow by blindly raising an unrelated memory setting; preserve the business rule for truncation or decomposition.
Versions
The locked catalogue records this condition from 7.4; cited core and extension paths are PostgreSQL 18.6 source. No limit was forced and no oversized extension value was created.
Related
Sources
contrib/hstore/hstore_io.c#L522-L525
src/backend/utils/mmgr/mcxt.c#L1683-L1718
src/backend/storage/smgr/md.c#L493-L504
src/backend/utils/adt/arraysubs.c#L147-L152
The structured evidence record records fixed messages and the source/runtime boundary.