SQLSTATE Mapping

NodeDB maps internal error codes to PostgreSQL SQLSTATE codes for pgwire compatibility.

NodeDB ErrorSQLSTATEPostgreSQL Meaning
Syntax error42601Syntax error
Collection not found42P01Undefined table
Column not found42703Undefined column
Type mismatch42846Cannot coerce
Unique violation23505Unique violation
FK violation23503Foreign key violation
Check violation23514Check violation
Not null violation23502Not null violation
Permission denied42501Insufficient privilege
Numeric overflow22003Numeric value out of range
Division by zero22012Division by zero
Rate limit exceeded54001Too many resources
Tenant quota exceeded54001Too many resources
Database quota exceeded54001Too many resources
Server overload54001Too many resources
Quota overcommit54000Program limit exceeded
Database not found42P01Undefined table
Mirror read only25006Read-only SQL transaction
Stale read on mirror0A000Feature not supported
Clone depth exceeded54000Program limit exceeded
Session not found42704Undefined object
Session idle timeout08006Connection failure
Session revoked08006Connection failure
Internal errorXX000Internal error
View page sourceLast updated on May 12, 2026 by Farhan Syah