Expand description
Standard PostgreSQL SQLSTATE code constants.
A single source of truth for every five-character SQLSTATE string used
across the codebase. Grouping follows the PostgreSQL documentation
appendix (Class 00–XX). All constants are &'static str so they compose
directly with pgwire::error::ErrorInfo without any allocation.
Add new codes here when a new error path needs one; never inline a literal elsewhere — a typo in a SQLSTATE string is undetectable at compile time.
Constants§
- APPEND_
ONLY_ VIOLATION 23601— NodeDB extension: append-only write rejected.- BALANCE_
VIOLATION 23602— NodeDB extension: balance constraint violated.- CANNOT_
CLONE_ MIRROR 0A000— NodeDB extension: a mirror database cannot be cloned.- CANNOT_
COERCE 42846—cannot_coerce- CANNOT_
CONNECT_ NOW 57P03—cannot_connect_now(collection is draining)- CANNOT_
DROP_ DEFAULT_ DATABASE 0A000— Cannot drop the built-indefaultdatabase, which is immutable. Aliased tofeature_not_supportedper the PostgreSQL convention for unsupported DDL operations on reserved objects.- CHECK_
VIOLATION 23514—check_violation- CLONE_
DEPENDENCY 55006— NodeDB extension: source database has active clone dependents.- CLONE_
DEPTH_ EXCEEDED 54011— NodeDB extension: clone chain depth exceedsMAX_CLONE_DEPTH.- CLONE_
PREDATES_ QUERY_ TIME 22023— NodeDB extension:AS OFtimestamp predates the clone’s creation point; the database did not exist at that time.- CONFIGURATION_
LIMIT_ EXCEEDED 53400—configuration_limit_exceeded(quota exceeded)- DATABASE_
DROPPED 57P04—database_dropped(not-leader redirect; client should retry elsewhere)- FEATURE_
NOT_ SUPPORTED 0A000—feature_not_supported- FOREIGN_
KEY_ VIOLATION 23503—foreign_key_violation(dangling-edge rejection)- INSUFFICIENT_
PRIVILEGE 42501—insufficient_privilege- INTEGRITY_
CONSTRAINT_ VIOLATION 23000—integrity_constraint_violation(generic)- INTERNAL_
ERROR XX000—internal_error- INVALID_
AUTHORIZATION 28000—invalid_authorization_specification(no valid credentials)- LEGAL_
HOLD_ ACTIVE 23607— NodeDB extension: legal hold blocks deletion.- LOCK_
NOT_ AVAILABLE 55P03—lock_not_available(no cluster leader)- MOVE_
TENANT_ ALREADY_ AT_ TARGET 02000—no_data: tenant is already present in the target database; theMOVE TENANTis a no-op (idempotent retry of a completed move).- MOVE_
TENANT_ CUTOVER_ FAILED XX000— internal error during cutover phase; source still holds data.- MOVE_
TENANT_ DRAIN_ TIMEOUT 57014—query_canceled: drain phase timed out; client should re-try after ensuring the tenant has no active connections on the source database.- MOVE_
TENANT_ PREFLIGHT_ FAILED 55P02—lock_not_available: pre-flight check found schema incompatibility between the source and target databases; no state was mutated.- MOVE_
TENANT_ SNAPSHOT_ FAILED XX000— internal error during snapshot phase; source left unchanged.- NOT_
NULL_ VIOLATION 23502—not_null_violation- NO_DATA
02000—no_data(document / row not found)- NUMERIC_
VALUE_ OUT_ OF_ RANGE 22003—numeric_value_out_of_range- OUT_
OF_ MEMORY 53200—out_of_memory- PERIOD_
LOCKED 23603— NodeDB extension: period lock; writes rejected.- PROGRAM_
LIMIT_ EXCEEDED 54000—program_limit_exceeded(generic over-cap)- QUERY_
CANCELED 57014—query_canceled(deadline exceeded)- QUOTA_
EXCEEDED 53400—configuration_limit_exceeded: tenant or database has exhausted its configured resource budget (TENANT_QUOTA_EXCEEDED,DATABASE_QUOTA_EXCEEDED). Class 53 is preferred over 54 because the limit is a runtime configuration setting, not a hard-coded program limit.- QUOTA_
OVERCOMMIT 53400—configuration_limit_exceeded: sum of tenant/database quotas would exceed the configured global or parent ceiling (QUOTA_OVERCOMMIT). Alias forCONFIGURATION_LIMIT_EXCEEDED.- RETENTION_
VIOLATION 23606— NodeDB extension: retention policy blocks deletion.- SERIALIZATION_
FAILURE 40001—serialization_failure(write conflict; client should retry)- SERVER_
OVERLOAD 57P03—cannot_connect_now: server is under global resource pressure and cannot accept new requests (SERVER_OVERLOAD). Using57P03rather than53300(too_many_connections) because the condition is transient and the server may accept requests again shortly — clients should retry after backoff.- STALE_
READ_ NOT_ LEADER 55P03— NodeDB extension: a strong or bounded-staleness read was requested on a mirror database that cannot satisfy the requested consistency level.- STATEMENT_
TOO_ COMPLEX 54001—statement_too_complex(fan-out / rate limit exceeded)- STATE_
TRANSITION_ VIOLATION 23604— NodeDB extension: state-transition constraint violated.- SUCCESS
00000—successful_completion- SYNTAX_
ERROR 42601—syntax_error- TOO_
MANY_ CONNECTIONS 53300—too_many_connections(closest match for rate-limit denial)- TRANSITION_
CHECK_ VIOLATION 23605— NodeDB extension: transition-check constraint violated.- TYPE_
GUARD_ VIOLATION 23608— NodeDB extension: type-guard constraint violated.- UNDEFINED_
TABLE 42P01—undefined_table(collection not found)- UNIQUE_
VIOLATION 23505—unique_violation- WARNING
01000—warning(generic warning)