PostgreSQL Error Codes: Complete reference of PostgreSQL error codes (SQLSTATE) with… Searchable index with fixes, code examples, and official sources.
PostgreSQL identifies errors by a five-character SQLSTATE code. The class letter matters more than you might think: class 23 (integrity constraint violations) fires on bad data, class 42 (syntax and name resolution) on bad SQL, class 08 on broken connections, and class 40/55 on concurrency and resource limits. Because SQLSTATEs are standardized, the same codes you meet in psql surface unchanged through Prisma, Supabase, and every driver — the pages below show both the raw SQL fix and the ORM-level handling.