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
Internal errorXX000Internal error
View page sourceLast updated on Apr 16, 2026 by Farhan Syah