Datatypes

SQLSTATE code

ID sqlstate

DatatypeNot PIIcategoricalDraft

This record is a draft: it has not been reviewed yet and may be incomplete or wrong. Do not rely on it for compliance decisions. Help improve it (see CONTRIBUTING.md).

Five-character code with which a SQL database reports the result of a statement, defined by the SQL standard. The first two characters are the class of the condition and the last three are the condition in that class. A code that ends in 000 is the generic code of its class. Codes use digits and capital letters. PostgreSQL, Db2, Oracle and ODBC and JDBC drivers return them, and database logs store them.

Categories
Software development
Countries
Global (not tied to a country)
Languages
Common to most languages
Quality
80/100 · missing: mapping (Wikidata, Schema.org, ...), detector coverage
Metacrafter rules
no detection rule yet
Supported by tools
no tool record lists this type yet

Regular expression

^[0-9A-Z]{5}$

Python re syntax.

Examples

ValueDescription
42601syntax_error in PostgreSQL
23505unique_violation in PostgreSQL
42P01undefined_table in PostgreSQL
40P01deadlock_detected in PostgreSQL
42p01 invalidLowercase letter

Translations

LanguageNameDescription
RussianКод SQLSTATE

Sources

Use this record