SQLSTATE
Compare versions ↗Error conditions, diagnostic context, and version-specific definitions.
| SQLSTATE | Version coverage 9.09.19.29.39.49.59.61011121314151617181920 |
|---|---|
00000Class 00 · Successful Completion successful_completion 00000 is the successful-completion SQLSTATE. PostgreSQL's error machinery selects it by default for messages below WARNING when no more specific code is set; a successful command does not need an error message. | 9.0 – 20 |
01000Class 01 · Warning warning 01000 is the generic warning condition in Class 01, Warning. It is a directory classification, not a description of one particular subsystem or message. PostgreSQL's source directory explicitly says not to use this class for failure conditions. | 9.0 – 20 |
01003Class 01 · Warning null_value_eliminated_in_set_function 01003 is a warning-category condition whose name describes null elimination in a set function. No resolved 18.6 core/contrib report group was found, so no PostgreSQL aggregate, message, or client severity path is confirmed here. | 9.0 – 20 |
01004Class 01 · Warning string_data_right_truncation 01004 names right truncation reported as a warning condition. No resolved 18.6 core/contrib report group was found, so this page does not assign a particular cast, encoding path, client, or message. | 9.0 – 20 |
01006Class 01 · Warning privilege_not_revoked 01006 has confirmed PostgreSQL 18.6 WARNING paths in src/backend/catalog/aclchk.c for REVOKE. It reports a partial or empty privilege change; the command can complete while sending the warning. | 9.0 – 20 |
01007Class 01 · Warning privilege_not_granted 01007 has confirmed PostgreSQL 18.6 WARNING paths in src/backend/catalog/aclchk.c for GRANT. It reports an empty or partial grant and does not by itself mean the GRANT statement failed as an error. | 9.0 – 20 |
01008Class 01 · Warning implicit_zero_bit_padding 01008 names a warning-category condition for implicit zero-bit padding. No resolved 18.6 core/contrib report group was found, so no specific bit-string conversion or message is confirmed. | 9.0 – 20 |
0100CClass 01 · Warning dynamic_result_sets_returned 0100C names a warning-category dynamic-result-set condition. No resolved 18.6 core/contrib report group was found, so no server-side producer, result-set count, or message is confirmed. | 9.0 – 20 |
01P01Class 01 · Warning deprecated_feature PostgreSQL 18.6 emits 01P01 at WARNING severity when a password-setting operation produces or preserves an MD5 verifier. This is a deprecation notice attached to a command that can still proceed, not a generic failure code for every old feature. | 9.0 – 20 |
02000Class 02 · No Data (this is also a warning class per the SQL standard) no_data 02000 has confirmed 18.6 DEBUG1/DEBUG2 paths in contrib/amcheck/verify_nbtree.c for internal index-check conditions. The three groups detailed below are each DEBUG1; they are not the same as a normal query returning zero rows and are not a generic c… | 9.0 – 20 |
02001Class 02 · No Data (this is also a warning class per the SQL standard) no_additional_dynamic_result_sets_returned 02001 is a no-data-category condition about additional dynamic result sets, not about an ordinary query returning no rows. No resolved 18.6 core/contrib report group was found. | 9.0 – 20 |
03000Class 03 · SQL Statement Not Yet Complete sql_statement_not_yet_complete 03000 is an error-category condition whose name indicates that the SQL statement is not yet complete. No resolved 18.6 core/contrib report group was found, so this page does not assign a parser, protocol, or client source. | 9.0 – 20 |
08000Class 08 · Connection Exception connection_exception SQLSTATE 08000 is connection_exception in Class 08. Connection exception is a broad connection-management condition. In the fixed PostgreSQL paths it is used by postgres_fdw when an abort-cleanup failure makes a foreign-server connection unusable; a… | 9.0 – 20 |
08001Class 08 · Connection Exception sqlclient_unable_to_establish_sqlconnection SQLSTATE 08001 is sqlclient_unable_to_establish_sqlconnection in Class 08. 08001 is the server-side SQLSTATE for a client connection that could not be established. In the selected dblink_connect path the ERROR primary is could not establish connecti… | 9.0 – 20 |
08003Class 08 · Connection Exception connection_does_not_exist SQLSTATE 08003 is connection_does_not_exist in Class 08. 08003 identifies a missing named connection handle in the current dblink backend session. It is a handle-lifecycle error, not evidence that the remote server is down (08001) or that an establi… | 9.0 – 20 |
08004Class 08 · Connection Exception sqlserver_rejected_establishment_of_sqlconnection SQLSTATE 08004 is sqlserver_rejected_establishment_of_sqlconnection in Class 08. 08004 is the SQL-standard name for a server-rejected connection establishment. The fixed PostgreSQL 18.6 and 10.23 core-call scans contain no resolved PostgreSQL erepor… | 9.0 – 20 |
08006Class 08 · Connection Exception connection_failure SQLSTATE 08006 is connection_failure in Class 08. 08006 names failure of an established connection. The fixed paths include postgres_fdw cancel/connection-loss handling and COPY failure handling; they do not define one universal primary or severity,… | 9.0 – 20 |
08007Class 08 · Connection Exception transaction_resolution_unknown SQLSTATE 08007 is transaction_resolution_unknown in Class 08. 08007 names an unknown transaction resolution. The fixed PostgreSQL 18.6 and 10.23 call scans contain no resolved core throw site for it. | 9.0 – 20 |
08P01Class 08 · Connection Exception protocol_violation SQLSTATE 08P01 is protocol_violation in Class 08. 08P01 means that a frontend/backend protocol message violated the wire contract. The selected raw TCP case completes startup and observes ReadyForQuery (Z), sends an unknown frontend byte Y in a vali… | 9.0 – 20 |
09000Class 09 · Triggered Action Exception triggered_action_exception SQLSTATE 09000 is an ERROR-level triggered-action condition. In the fixed PostgreSQL 18.6 scan, resolved report paths are in contrib/spi trigger functions: they validate trigger arguments, target-column types, referenced tuples, and SPI return codes… | 9.0 – 20 |
0A000Class 0A · Feature Not Supported feature_not_supported SQLSTATE 0A000 is feature_not_supported in Class 0A. 0A000 means a recognized feature or option is unsupported in the selected context. The selected hash-index path requests id ASC, reports access method "hash" does not support ASC/DESC options, the… | 9.0 – 20 |
0B000Class 0B · Invalid Transaction Initiation invalid_transaction_initiation SQLSTATE 0B000 names the SQL-standard Invalid Transaction Initiation class. The locked PostgreSQL 18.6 definition contains the condition, but the resolved core/contrib call scan did not identify a PostgreSQL report group for this code. Treat the cla… | 9.0 – 20 |
0F000Class 0F · Locator Exception locator_exception SQLSTATE 0F000 is the Locator Exception class. It is a category code, not a concrete locator failure message. The PostgreSQL 18.6 definition is present, but the locked core/contrib scan did not resolve a 0F000 report group. A client, embedded-SQL la… | 9.0 – 20 |
0F001Class 0F · Locator Exception invalid_locator_specification SQLSTATE 0F001 is the Invalid Locator Specification member of Class 0F. The locked PostgreSQL definition records the SQL-standard identity, but the resolved PostgreSQL 18.6 core/contrib scan did not find an emitting call. Do not turn the condition n… | 9.0 – 20 |
0L000Class 0L · Invalid Grantor invalid_grantor SQLSTATE 0L000 is invalid_grantor in Class 0L. The fixed aclparse path uses it as a backward-compatible warning when old ACL item text omits the /grantor suffix: it defaults the grantor to BOOTSTRAP_SUPERUSERID. This is ACL text parsing, not a boots… | 9.0 – 20 |
0LP01Class 0L · Invalid Grantor invalid_grant_operation SQLSTATE 0LP01 is invalid_grant_operation in Class 0L. 0LP01 means that the GRANT or REVOKE operation is invalid for the object or privilege. The selected sequence case asks for INSERT, which is rejected with the dynamically assembled primary invali… | 9.0 – 20 |
0P000Class 0P · Invalid Role Specification invalid_role_specification SQLSTATE 0P000 is invalid_role_specification in Class 0P. Under ENABLE_SSPI, the fixed Windows SSPI path uses it for server LOG branches while converting a SAM account name to a UPN; it is not a generic missing-role login result or a client ErrorRes… | 9.0 – 20 |
0Z000Class 0Z · Diagnostics Exception diagnostics_exception SQLSTATE 0Z000 is the Diagnostics Exception category. In PostgreSQL's fixed source, the concrete PL/pgSQL path is the member 0Z002; the category row itself is not a separate report group. Use 0Z000 to classify an observed diagnostics member, then ke… | 9.2 – 20 |
0Z002Class 0Z · Diagnostics Exception stacked_diagnostics_accessed_without_active_handler SQLSTATE 0Z002 is emitted by PL/pgSQL when code tries to use stacked exception state without the active exception handler that owns it. PostgreSQL 18.6 has two confirmed paths: GET STACKED DIAGNOSTICS cannot be used outside an exception handler and … | 9.2 – 20 |
10608Class 10 · XQuery Error invalid_argument_for_xquery SQLSTATE 10608 is an ERROR-level XQuery-class condition for an invalid argument. PostgreSQL 18.6 has resolved backend XML paths for an empty XPath expression, an empty row path filter, and an empty column path filter. The contrib/xml2 sources also r… | 18 – 20 |
20000Class 20 · Case Not Found case_not_found SQLSTATE 20000 is raised by PL/pgSQL for a CASE statement that reaches no matching WHEN and has no ELSE. PostgreSQL 18.6 reports case not found with hint CASE statement is missing ELSE part. The condition is about the procedural CASE statement path;… | 9.0 – 20 |
21000Class 21 · Cardinality Violation cardinality_violation 21000 means that an operation received the wrong number of rows for its cardinality contract. The common user-visible case is a scalar subquery that returns more than one row. It is different from 23505: no unique index conflict is required. | 9.0 – 20 |
22000Class 22 · Data Exception data_exception 22000 is dataexception. The fixed arrayappend path accepts an empty or one-dimensional array argument and reports the dimensionality requirement otherwise; other Data Exception paths belong to their own subsystem. | 9.0 – 20 |
22001Class 22 · Data Exception string_data_right_truncation 22001 is stringdataright_truncation. The fixed varchar path reports the declared character width, while hstore and varbit have separate variants. | 9.0 – 20 |
22002Class 22 · Data Exception null_value_no_indicator_parameter 22002 is nullvaluenoindicatorparameter, an ECPG-oriented condition. The fixed 18.6 call archive has no resolved native report group in this scan. | 9.0 – 20 |
22003Class 22 · Data Exception numeric_value_out_of_range 22003 is numericvalueoutofrange. Fixed paths cover integer conversion, numeric overflow, and subsystem-specific range checks; the page centers on numeric conversion and preserves those boundaries. | 9.0 – 20 |
22004Class 22 · Data Exception null_value_not_allowed 22004 is nullvaluenot_allowed. The fixed table-function path rejects a null namespace URI; many other extensions and core functions use the same condition for different null contracts. | 9.0 – 20 |
22005Class 22 · Data Exception error_in_assignment 22005 is errorinassignment. The fixed PL/pgSQL path reports assignment to a variable declared CONSTANT; ECPG and other assignment layers may have separate boundaries. | 9.0 – 20 |
22007Class 22 · Data Exception invalid_datetime_format 22007 is invaliddatetimeformat. The fixed interval-formatting path reports an invalid format specification and explains that intervals are not tied to specific calendar dates. | 9.0 – 20 |
22008Class 22 · Data Exception datetime_field_overflow 22008 is datetimefieldoverflow. Fixed date.c paths report out-of-range date values, date fields, and time fields; the exact message identifies which conversion or operation failed. | 9.0 – 20 |
22009Class 22 · Data Exception invalid_time_zone_displacement_value 22009 is invalidtimezonedisplacementvalue. The fixed timetz_recv binary-input path rejects a GMT displacement outside the supported range. | 9.0 – 20 |
2200BClass 22 · Data Exception escape_character_conflict 2200B is escapecharacterconflict. The fixed 18.6 call archive has no resolved native report group in this scan. | 9.0 – 20 |
2200CClass 22 · Data Exception invalid_use_of_escape_character The SQL SIMILAR TO pattern translator rejected its escape-double-quote structure before matching. PostgreSQL 18.6 has a concrete regexp.c path that raises SQL regular expression may not contain more than two escape-double-quote separators; this is a… | 9.0 – 20 |
2200DClass 22 · Data Exception invalid_escape_octet The catalogue condition covers an invalid escape octet. The fixed scan did not resolve a PostgreSQL 18.6 emitting function for this entry, so the condition is useful as a classification boundary rather than proof of one native parser call. | 9.0 – 20 |
2200FClass 22 · Data Exception zero_length_character_string The condition identifies an operation that rejects an empty character string. In the fixed fuzzystrmatch path, metaphone returns empty text immediately for empty input; only after that early return does it read reqlen, and a non-positive requested o… | 9.0 – 20 |
2200GClass 22 · Data Exception most_specific_type_mismatch This condition names a most-specific-type mismatch during type resolution. No fixed PostgreSQL 18.6 emitting path was resolved in the bounded call scan, so the page stays conditional and does not turn a generic cast or operator error into 2200G. | 9.0 – 20 |
2200HClass 22 · Data Exception sequence_generator_limit_exceeded A sequence allocation reached its configured limit while trying to obtain the next value. PostgreSQL 18.6’s sequence.c path reports source templates for both maximum and minimum limits. The endpoint value itself can be legal, and the numeric value u… | 10 – 20 |
2200LClass 22 · Data Exception not_an_xml_document The SQL/XML SQLSERIALIZE DOCUMENT operation received input that could not satisfy the requested document form. PostgreSQL 18.6 maps this public DOCUMENT path through xmltotextwithoptions with XMLOPTION_DOCUMENT; a failed or soft parse is mapped to n… | 9.0 – 20 |
2200MClass 22 · Data Exception invalid_xml_document This catalogue member denotes an invalid XML document. PostgreSQL 18.6 has a core xml_parse document branch that reports invalid XML document, and the contrib/xml2 XSLT path reports the same SQLSTATE for a failed source document or stylesheet parse.… | 9.0 – 20 |
2200NClass 22 · Data Exception invalid_xml_content This member covers invalid XML content. PostgreSQL 18.6’s core XML parser has a content-mode declaration guard and content-parse guards that report 2200N; the original XML option determines whether a document parse failure is instead reported as 220… | 9.0 – 20 |
2200SClass 22 · Data Exception invalid_xml_comment An XML comment is invalid. PostgreSQL 18.6’s xmlcomment path reports invalid XML comment when the comment text contains the forbidden -- sequence or ends in -; this is comment-specific XML syntax rather than a general document failure. | 9.0 – 20 |
2200TClass 22 · Data Exception invalid_xml_processing_instruction An XML processing instruction violates its XML syntax. PostgreSQL 18.6’s xmlpi path rejects a target whose name is case-insensitively xml, or a non-NULL body containing ?>; both guards report invalid XML processing instruction with a branch-specific… | 9.0 – 20 |
22010Class 22 · Data Exception invalid_indicator_parameter_value An indicator parameter value does not satisfy the indicator or descriptor rules of the operation consuming it. The fixed PostgreSQL 18.6 catalogue confirms the condition, but the bounded source scan does not bind it to a native emitter, message temp… | 9.0 – 20 |
22011Class 22 · Data Exception substring_error A text substring path received an invalid explicit length. In fixed PostgreSQL 18.6 code, text_substring reports negative substring length not allowed with SQLSTATE 22011. | 9.0 – 20 |
22012Class 22 · Data Exception division_by_zero A division or modulo operation reached a zero divisor. PostgreSQL 18.6 uses SQLSTATE 22012 in numeric, integer, floating-point, money, and interval-division paths, while each path keeps its own operand and special-value rules. | 9.0 – 20 |
22013Class 22 · Data Exception invalid_preceding_or_following_size A window-frame offset is negative in a fixed ROWS or GROUPS executor path. PostgreSQL 18.6 reports either frame starting offset must not be negative or frame ending offset must not be negative with SQLSTATE 22013. | 11 – 20 |
22014Class 22 · Data Exception invalid_argument_for_ntile_function ntile received a non-positive bucket count. The fixed window-function path reports argument of ntile must be greater than zero with SQLSTATE 22014. | 9.0 – 20 |
22015Class 22 · Data Exception interval_field_overflow An interval input field exceeds the range accepted by the interval decoder. PostgreSQL 18.6 maps that datetime parsing condition to SQLSTATE 22015; later interval construction or arithmetic can use different range codes. | 9.0 – 20 |
22016Class 22 · Data Exception invalid_argument_for_nth_value_function nthvalue received a non-positive ordinal. The fixed window-function path reports argument of nthvalue must be greater than zero with SQLSTATE 22016. | 9.0 – 20 |
22018Class 22 · Data Exception invalid_character_value_for_cast A character value is rejected by the conversion requested by an operation. The fixed PostgreSQL 18.6 catalogue confirms invalidcharactervalueforcast, but the bounded source scan does not bind this entry to one native emitter or message template. | 9.0 – 20 |
22019Class 22 · Data Exception invalid_escape_character An operation rejected its escape argument. The fixed catalogue defines invalidescapecharacter, but the bounded PostgreSQL 18.6 source scan found no native emitter to which one message or severity can safely be attached. | 9.0 – 20 |
2201BClass 22 · Data Exception invalid_regular_expression SQL regular-expression compilation and execution have separate 2201B paths, and HBA/ident configuration handling uses the same code with log-level reporting. The fixed messages and severities must be read by owner rather than merged into one generic… | 9.0 – 20 |
2201EClass 22 · Data Exception invalid_argument_for_logarithm Logarithm functions reject zero and negative inputs at their defined-domain guards. Fixed float paths report cannot take logarithm of zero or cannot take logarithm of a negative number; numeric ln and base-log paths apply the same SQLSTATE while han… | 9.0 – 20 |
2201FClass 22 · Data Exception invalid_argument_for_power_function Power functions reject operands whose real-valued result is undefined. Fixed numeric paths report zero raised to a negative power is undefined or a negative number raised to a non-integer power yields a complex result. | 9.0 – 20 |
2201GClass 22 · Data Exception invalid_argument_for_width_bucket_function width_bucket validates its bucket count, NaN inputs, histogram bounds, and bound equality. The fixed numeric and float8 paths report distinct 2201G messages for non-positive count, NaN, non-finite bounds, and equal bounds. | 9.0 – 20 |
2201WClass 22 · Data Exception invalid_row_count_in_limit_clause A LIMIT or FETCH row count fails a form-specific guard. Fixed paths report LIMIT must not be negative; the parser separately rejects a literal NULL row count in FETCH FIRST ... WITH TIES. | 9.0 – 20 |
2201XClass 22 · Data Exception invalid_row_count_in_result_offset_clause An OFFSET expression is negative after evaluation. The fixed executor path reports OFFSET must not be negative. | 9.0 – 20 |
22021Class 22 · Data Exception character_not_in_repertoire A source byte sequence is invalid for the encoding being checked. The fixed conversion path reports invalid byte sequence for encoding "%s": %s and formats the offending bytes. | 9.0 – 20 |
22022Class 22 · Data Exception indicator_overflow The catalogue condition names an indicator value that cannot fit its interface representation. The bounded PostgreSQL 18.6 source review confirms the definition but does not bind a native emitting report group. | 9.0 – 20 |
22023Class 22 · Data Exception invalid_parameter_value A named parameter, option, descriptor, or function argument is outside the domain accepted by its owner. Fixed representatives cover built-in GUC parsing, amcheck descriptors/options, postgres_fdw option validation, and regular-expression option che… | 9.0 – 20 |
22024Class 22 · Data Exception unterminated_c_string The catalogue condition names a C-style string that ended before its required terminator. The bounded PostgreSQL 18.6 source review confirms the definition but does not bind a native emitting report group. | 9.0 – 20 |
22025Class 22 · Data Exception invalid_escape_sequence An escape sequence is invalid for its specific consumer. Fixed paths distinguish a LIKE escape argument that is not empty or one character, a LIKE pattern ending in an escape character, a regular-expression translation escape argument with the same … | 9.0 – 20 |
22026Class 22 · Data Exception string_data_length_mismatch A bit-string value has the wrong declared length. The fixed varbit.c path reports bit string length %d does not match type bit(%d); bitwise operands have separate mismatch messages. | 9.0 – 20 |
22027Class 22 · Data Exception trim_error The trim operation rejected its argument or trim specification. No fixed PostgreSQL 18.6 emitting path was resolved in the bounded scan. | 9.0 – 20 |
2202EClass 22 · Data Exception array_subscript_error 2202E is PostgreSQL's arraysubscripterror condition in Class 22, Data Exception. The directory keeps ERRCODEARRAYELEMENTERROR as a compatibility alias and uses ERRCODEARRAYSUBSCRIPTERROR for the named condition. Both macros encode the same SQLSTATE. | 9.0 – 20 |
2202GClass 22 · Data Exception invalid_tablesample_repeat The TABLESAMPLE REPEATABLE seed is invalid when it is NULL. The fixed executor path reports TABLESAMPLE REPEATABLE parameter cannot be null. | 9.5 – 20 |
2202HClass 22 · Data Exception invalid_tablesample_argument A TABLESAMPLE method received an invalid argument. Fixed core and contrib methods reject out-of-range percentages or negative sample sizes with method-specific messages. | 9.5 – 20 |
22030Class 22 · Data Exception duplicate_json_object_key_value A JSON object construction encountered a duplicate key. The fixed unique-key JSON builder and aggregate paths report duplicate JSON object key value: %s; JSONB finalization has a related variant. | 12 – 20 |
22031Class 22 · Data Exception invalid_argument_for_sql_json_datetime_function A SQL/JSON datetime method received an invalid type, precision, or format. Fixed jsonpath execution reports an unrecognized format and hints to use a datetime template argument. | 13 – 20 |
22032Class 22 · Data Exception invalid_json_text JSON text is invalid for the consuming operation. No fixed 18.6 emitting report group was resolved in the bounded scan. | 12 – 20 |
22033Class 22 · Data Exception invalid_sql_json_subscript A SQL/JSON array subscript is invalid. Fixed jsonpath paths distinguish out-of-bounds, non-single-numeric, and integer-range variants. | 12 – 20 |
22034Class 22 · Data Exception more_than_one_sql_json_item A SQL/JSON query returned more than one item where the operation requires one. Fixed JSONQUERY/JSONVALUE paths report single-item or single-scalar requirements and may hint to use WITH WRAPPER. | 12 – 20 |
22035Class 22 · Data Exception no_sql_json_item A SQL/JSON path found no item for the requested operation. Fixed expression execution reports no SQL/JSON item found for specified path. | 12 – 20 |
22036Class 22 · Data Exception non_numeric_sql_json_item A JSON path item method received a value that cannot satisfy its numeric or conversion contract. The fixed paths cover .number(), .decimal(), .integer(), .bigint(), .double(), .boolean(), .abs(), .floor(), .ceiling(), and the corresponding type chec… | 12 – 20 |
22037Class 22 · Data Exception non_unique_keys_in_a_json_object The locked condition names a non-unique-key error for a JSON object. No fixed PostgreSQL 18.6 emitting path was resolved in the bounded scan. | 12 – 20 |
22038Class 22 · Data Exception singleton_sql_json_item_required A SQL/JSON path operation expected one result of a required type, but received another cardinality or type. The fixed paths cover a singleton boolean result and the two numeric operands of binary jsonpath arithmetic; the SQL function and the @@ oper… | 12 – 20 |
22039Class 22 · Data Exception sql_json_array_not_found An array-only JSON path accessor or item method reached a non-array item without permitted auto-wrap or structural-error suppression. Fixed wildcard, indexed, and .size() paths expose separate array-type primaries; an out-of-bounds subscript is 2203… | 12 – 20 |
2203AClass 22 · Data Exception sql_json_member_not_found A named JSON object member cannot be read from the current item. Fixed jsonpath member access distinguishes a missing key from a non-object receiver. | 12 – 20 |
2203BClass 22 · Data Exception sql_json_number_not_found A unary jsonpath arithmetic operator needs a numeric operand but receives another item type. This is the unary-operator boundary, separate from numeric conversion methods. | 12 – 20 |
2203CClass 22 · Data Exception sql_json_object_not_found An object-only JSON path accessor or .keyvalue() method received a non-object item. Wildcard member access and object key/value expansion use this structural guard. | 12 – 20 |
2203DClass 22 · Data Exception too_many_json_array_elements The locked condition names an excessive number of JSON array elements. No fixed PostgreSQL 18.6 emitting path was resolved in the bounded scan. | 12 – 20 |
2203EClass 22 · Data Exception too_many_json_object_members The locked condition names an excessive number of JSON object members. No fixed PostgreSQL 18.6 emitting path was resolved in the bounded scan. | 12 – 20 |
2203FClass 22 · Data Exception sql_json_scalar_required A JSON_VALUE operation received one item, but that item was not a scalar. Multiple items are handled earlier as 22034; empty results are handled by the empty/ON EMPTY path. | 12 – 20 |
2203GClass 22 · Data Exception sql_json_item_cannot_be_cast_to_target_type 2203G is the catalogue condition sqljsonitemcannotbecasttotargettype. In the fixed PostgreSQL 18.6 tree, the bounded search found its macro in errcodes.txt but no core or contrib call that emits it. This is therefore a definition-only reference; a J… | 15 – 20 |
22P01Class 22 · Data Exception floating_point_exception PostgreSQL's fixed core path installs FloatExceptionHandler for SIGFPE. The handler emits an ERROR with primary floating-point exception and detail stating that an invalid floating-point operation was signaled, probably because of an out-of-range re… | 9.0 – 20 |
22P02Class 22 · Data Exception invalid_text_representation 22P02 means a text input routine cannot interpret a value as the requested type. This page selects the ordinary integer input path and also marks the COPY/text boundary; COPY, enum, extension, and contrib callers can use different primary messages. | 9.0 – 20 |
22P03Class 22 · Data Exception invalid_binary_representation 22P03 is PostgreSQL's invalid-binary-representation boundary. In the fixed source it covers binary COPY fields, extended-protocol Bind parameters, fast-path function arguments, logical-replication columns, and guards inside representative type recei… | 9.0 – 20 |
22P04Class 22 · Data Exception bad_copy_file_format 22P04 is the COPY file-format boundary. The fixed parser uses it for binary signatures and headers, text or CSV framing, header/row field counts, and malformed binary field lengths. It is a structural COPY error, not a generic synonym for a value th… | 9.0 – 20 |
22P05Class 22 · Data Exception untranslatable_character PostgreSQL could identify a source character but could not represent it in the destination encoding. The fixed helper reports the offending bytes and both encoding names with primary character with byte sequence %s in encoding "%s" has no equivalent… | 9.0 – 20 |
22P06Class 22 · Data Exception nonstandard_use_of_escape_character The SQL scanner found a backslash escape form that is nonstandard or unsafe under the current string-literal settings. PostgreSQL 18.6 has one ERROR branch for unsafe quote escaping and three WARNING branches for backslash-quote, backslash-backslash… | 9.0 – 20 |
23000Class 23 · Integrity Constraint Violation integrity_constraint_violation 23000 names the Class 23 integrity-constraint umbrella. It is a protocol category, not a reliable substitute for a concrete PostgreSQL constraint error. Use the exact five-character code returned by the server. | 9.0 – 20 |
23001Class 23 · Integrity Constraint Violation restrict_violation 23001 is the specific RESTRICT violation condition. In the selected PostgreSQL 18.6 case, deleting a referenced parent row raised it with the child constraint and key in the diagnostic. PostgreSQL 10 reported the same tested operation through 23503,… | 9.0 – 20 |
23502Class 23 · Integrity Constraint Violation not_null_violation 23502 means a NULL reached a NOT NULL rule. The selected case identifies column label and relation items; the exact PG18 and PG10 primary messages differ slightly in relation wording, while the SQLSTATE and structured object identity agree. | 9.0 – 20 |
23503Class 23 · Integrity Constraint Violation foreign_key_violation 23503 is PostgreSQL's foreignkeyviolation condition in Class 23, integrityconstraintviolation. A child insert or update without a matching parent key, or an ordinary parent key action covered by the foreign-key rules, can produce it. In PostgreSQL 1… | 9.0 – 20 |
23505Class 23 · Integrity Constraint Violation unique_violation 23505 is PostgreSQL's unique_violation condition. A row, an index build, or a logical-apply operation found a value that cannot coexist with an enforced unique invariant. | 9.0 – 20 |
23514Class 23 · Integrity Constraint Violation check_violation 23514 means a CHECK or related row constraint evaluated as false. The selected named constraint is amount_positive; the server reports the table and constraint and the invalid row detail. | 9.0 – 20 |
23P01Class 23 · Integrity Constraint Violation exclusion_violation 23P01 means an exclusion constraint found an existing row for which all configured comparison operators conflict. The selected range case uses &&, so it rejects an overlap rather than merely a duplicate value. | 9.0 – 20 |
24000Class 24 · Invalid Cursor State invalid_cursor_state 24000 means the cursor or portal state does not satisfy the operation. The selected CURRENT OF case declares a valid cursor but tries to update before FETCH has positioned it, producing “cursor ... is not positioned on a row”. | 9.0 – 20 |
25000Class 25 · Invalid Transaction State invalid_transaction_state 25000 is the broad Class 25 invalid transaction state. The locked 18.6 source uses it for internal states such as executing a utility or defining a savepoint during a parallel operation. This batch does not claim a safe ordinary SQL reproduction. | 9.0 – 20 |
25001Class 25 · Invalid Transaction State active_sql_transaction 25001 means the command requires a transaction boundary that the current session violates. The selected case runs VACUUM after BEGIN, receives the exact active-transaction error, rolls back, and then successfully runs VACUUM outside the transaction … | 9.0 – 20 |
25002Class 25 · Invalid Transaction State branch_transaction_already_active 25002 names a branch transaction that is already active. It is narrower than 25001 and separate from 25P02; this page records the locked condition definition and the absence of a resolved core 18.6 call site. | 9.0 – 20 |
25003Class 25 · Invalid Transaction State inappropriate_access_mode_for_branch_transaction 25003 is the SQLSTATE name for an inappropriate access mode in a branch transaction. The fixed PostgreSQL 18.6 core scan resolves no direct report site, so this entry documents the definition boundary without inventing an ordinary SQL trigger. | 9.0 – 20 |
25004Class 25 · Invalid Transaction State inappropriate_isolation_level_for_branch_transaction 25004 names an inappropriate isolation level for a branch transaction. The fixed PostgreSQL 18.6 resolved-call scan has no direct report group for this code, so no ordinary SQL reproduction is claimed. | 9.0 – 20 |
25005Class 25 · Invalid Transaction State no_active_sql_transaction_for_branch_transaction 25005 is the branch-transaction form of a no-active-SQL-transaction condition. It is distinct from 25P01, and the fixed PostgreSQL 18.6 core scan does not resolve a natural server call site. | 9.0 – 20 |
25006Class 25 · Invalid Transaction State read_only_sql_transaction 25006 is returned when a command would write in a read-only transaction. The selected case issues CREATE TABLE after SET TRANSACTION READ ONLY, observes INERROR, rolls back, and creates the table after leaving the read-only block. | 9.0 – 20 |
25007Class 25 · Invalid Transaction State schema_and_data_statement_mixing_not_supported 25007 names a transaction-state condition for mixing schema and data statements. The fixed PostgreSQL 18.6 core scan resolves no direct report group, so this page does not manufacture a SQL example. | 9.0 – 20 |
25008Class 25 · Invalid Transaction State held_cursor_requires_same_isolation_level 25008 is reserved for a held cursor whose transaction isolation level is not compatible with the required operation. The fixed PostgreSQL 18.6 core scan has no direct report group for it. | 9.0 – 20 |
25P01Class 25 · Invalid Transaction State no_active_sql_transaction 25P01 reports that an operation needs an active SQL transaction. The selected case sends SAVEPOINT with autocommit enabled, receives the exact error while the session remains IDLE, then repeats the operation inside BEGIN and commits. | 9.0 – 20 |
25P02Class 25 · Invalid Transaction State in_failed_sql_transaction 25P02 is usually the second diagnostic, not the root cause. In the selected case a duplicate key first returns 23505; a following SELECT is rejected with 25P02 while the block remains INERROR. ROLLBACK is required before a valid retry. | 9.0 – 20 |
25P03Class 25 · Invalid Transaction State idle_in_transaction_session_timeout 25P03 is a FATAL session-termination condition. It fires when a session is waiting for the next client query inside an open transaction longer than the effective idleintransactionsessiontimeout. The selected case uses 300 ms as a harness trigger, no… | 9.6 – 20 |
25P04Class 25 · Invalid Transaction State transaction_timeout 25P04 is a FATAL condition emitted by transaction_timeout, which covers both an explicit BEGIN transaction and an implicitly started single-statement transaction. The selected 18.6 case uses 300 ms; PG10 is a source/version preflight skip because th… | 17 – 20 |
26000Class 26 · Invalid SQL Statement Name invalid_sql_statement_name 26000 means that PostgreSQL was asked to use a named prepared statement that does not exist in the current backend session. It is a session-resource lookup failure, so first check session affinity and statement lifecycle before changing the SQL text. | 9.0 – 20 |
27000Class 27 · Triggered Data Change Violation triggered_data_change_violation 27000 is a source-confirmed trigger-protection condition. PostgreSQL raises it when a row has already been changed by an operation triggered by the current command; the fixed 18.6 source hint points toward using an AFTER trigger when the intent is t… | 9.0 – 20 |
28000Class 28 · Invalid Authorization Specification invalid_authorization_specification SQLSTATE 28000 is invalid_authorization_specification in Class 28. 28000 is the authorization-specification class for rejected startup or authorization context. The selected missing-role startup path sends C=28000, S=FATAL, and role "<generated>" do… | 9.0 – 20 |
28P01Class 28 · Invalid Authorization Specification invalid_password 28P01 is PostgreSQL's invalidpassword condition in Class 28, invalidauthorizationspecification. It identifies a password authentication failure while a client is establishing a session. The authentication method, the matched pghba.conf rule, and the… | 9.0 – 20 |
2B000Class 2B · Dependent Privilege Descriptors Still Exist dependent_privilege_descriptors_still_exist 2B000 is a catalogue-defined condition for dependent privilege descriptors. The fixed source scan did not resolve a distinct core 2B000 ereport path in this batch, so the page records the definition boundary and does not label a role, REVOKE, or DRO… | 9.0 – 20 |
2BP01Class 2B · Dependent Privilege Descriptors Still Exist dependent_objects_still_exist 2BP01 means a DROP or related catalog operation would remove an object that other database objects still require. The useful repair is dependency-aware: identify the dependent object, decide whether it should be removed or retained, and only then re… | 9.0 – 20 |
2D000Class 2D · Invalid Transaction Termination invalid_transaction_termination 2D000 is the SPI guard used when a procedure or subtransaction context attempts an invalid transaction termination. The fixed 18.6 path distinguishes invalid termination from a normal explicit COMMIT; this batch does not claim that every procedure-l… | 9.0 – 20 |
2F000Class 2F · SQL Routine Exception sql_routine_exception SQLSTATE 2F000 is the SQL Routine Exception category. The definition is present in the locked catalogue, but the resolved PostgreSQL 18.6 core/contrib call scan did not identify a native 2F000 report group. The class should therefore organize routin… | 9.0 – 20 |
2F002Class 2F · SQL Routine Exception modifying_sql_data_not_permitted SQLSTATE 2F002 names the standard SQL Routine Exception member for modifying SQL data when the routine’s declared data-access contract does not permit it. The locked PostgreSQL 18.6 definition contains the member, but its resolved core/contrib call … | 9.0 – 20 |
2F003Class 2F · SQL Routine Exception prohibited_sql_statement_attempted The fixed scan confirms this ERROR in both dblink and postgres_fdw connection paths. dblink also reports it when a command would return rows where the dblink API expects no result. The authentication variants are wrapper/connection policy paths, not… | 9.0 – 20 |
2F004Class 2F · SQL Routine Exception reading_sql_data_not_permitted The catalogue defines this standard member, but the resolved PostgreSQL 18.6 core/contrib scan found no native report group. Do not infer a PostgreSQL function volatility or language rule from the condition name. | 9.0 – 20 |
2F005Class 2F · SQL Routine Exception function_executed_no_return_statement PL/pgSQL reports 2F005 at ERROR level when a function or trigger procedure reaches the end without the required RETURN. The fixed 18.6 paths distinguish an ordinary function from a trigger procedure in their messages. | 9.0 – 20 |
34000Class 34 · Invalid Cursor Name invalid_cursor_name 34000 means that a cursor or portal name cannot be resolved in the current backend session. A cursor that was closed, declared on another pooled connection, or ended with its transaction is not the same resource as a cursor with a bad position (2400… | 9.0 – 20 |
38000Class 38 · External Routine Exception external_routine_exception Class 38 is broad. Fixed PostgreSQL 18.6 paths include external command failures in COPY ... PROGRAM and basebackuptoshell, UUID library failures, and exceptions propagated from PL/Perl, PL/Python, and PL/Tcl. These are separate implementations unde… | 9.0 – 20 |
38001Class 38 · External Routine Exception containing_sql_not_permitted The fixed definition records this Class 38 member, but the resolved PostgreSQL 18.6 core/contrib scan found no report group for it. It is a standard routine boundary condition, not a confirmed PostgreSQL message. | 9.0 – 20 |
38002Class 38 · External Routine Exception modifying_sql_data_not_permitted This Class 38 member names a modifying-data restriction. The fixed PostgreSQL 18.6 core/contrib scan found no resolved report group for it, so it must not be conflated with the separately named 2F002 member. | 9.0 – 20 |
38003Class 38 · External Routine Exception prohibited_sql_statement_attempted The Class 38 member is defined, but no resolved PostgreSQL 18.6 core/contrib report group was found. It is distinct from Class 2F member 2F003 even though the condition names match. | 9.0 – 20 |
38004Class 38 · External Routine Exception reading_sql_data_not_permitted The Class 38 member is a standard reading-data restriction, but the bounded PostgreSQL 18.6 core/contrib scan found no resolved report group. It should remain separate from 2F004. | 9.0 – 20 |
39000Class 39 · External Routine Invocation Exception external_routine_invocation_exception Fixed PostgreSQL 18.6 paths in contrib/pgcrypto report this ERROR for cryptographic library failures and invalid input lengths. The category can also carry other external routine invocation errors, so the exact library function and dynamic error tex… | 9.0 – 20 |
39001Class 39 · External Routine Invocation Exception invalid_sqlstate_returned The fixed definition contains this member, but the resolved PostgreSQL 18.6 core/contrib scan found no report group. The name describes an external routine returning an invalid SQLSTATE; it does not identify a current PostgreSQL handler path. | 9.0 – 20 |
39004Class 39 · External Routine Invocation Exception null_value_not_allowed 39004 is nullvaluenot_allowed. The fixed definition is present, but the bounded PostgreSQL 18.6 call archive has no resolved report group for this code; diagnose the actual routine or extension boundary before assigning an operation. | 9.0 – 20 |
39P01Class 39 · External Routine Invocation Exception trigger_protocol_violated 39P01 is triggerprotocolviolated. Fixed PostgreSQL 18.6 paths cover the core trigger manager, contrib/tcn checks, and PL/Perl trigger return handling, with path-specific messages and severity. | 9.0 – 20 |
39P02Class 39 · External Routine Invocation Exception srf_protocol_violated 39P02 is srfprotocolviolated. The fixed executor path checks value-per-call and materialize set-returning-function contracts and reports the exact violated return mode. | 9.0 – 20 |
39P03Class 39 · External Routine Invocation Exception event_trigger_protocol_violated 39P03 is eventtriggerprotocolviolated. Fixed event-trigger helpers reject calls outside their required sqldrop, table_rewrite, or event-trigger function context. | 9.5 – 20 |
3B000Class 3B · Savepoint Exception savepoint_exception 3B000 is the savepoint-exception class definition. The fixed core call scan resolves the more specific 3B001 missing-savepoint path rather than a separate generic 3B000 throw site. Use the concrete server SQLSTATE when diagnosing a savepoint failure… | 9.0 – 20 |
3B001Class 3B · Savepoint Exception invalid_savepoint_specification 3B001 means that a savepoint operation named a savepoint that is absent at the current transaction level. It is different from 25P01, which means there is no active transaction block at all. | 9.0 – 20 |
3D000Class 3D · Invalid Catalog Name invalid_catalog_name SQLSTATE 3D000 is invalid_catalog_name in Class 3D. 3D000 identifies an invalid database/catalog name. It can occur before startup completes when a requested database is absent, and fixed dbcommands.c paths also emit it while a SQL command resolves … | 9.0 – 20 |
3F000Class 3F · Invalid Schema Name invalid_schema_name SQLSTATE 3F000 is invalid_schema_name in Class 3F. 3F000 means a schema name cannot be resolved in an established session. The selected qualified-table path receives schema "<generated>" does not exist, while fixed namespace and schema-command paths… | 9.0 – 20 |
40000Class 40 · Transaction Rollback transaction_rollback 40000 is an umbrella transaction-rollback condition. The fixed 18.6 source contains an internal system-catalog-scan path with transaction aborted during system catalog scan; reproducing that path would require an internal fault or visibility conditi… | 9.0 – 20 |
40001Class 40 · Transaction Rollback serialization_failure 40001 is PostgreSQL's serializationfailure condition in Class 40, transactionrollback. It tells the client that the transaction's observed ordering cannot be serialized with a concurrent transaction. PostgreSQL aborts the conflicting transaction so … | 9.0 – 20 |
40002Class 40 · Transaction Rollback transaction_integrity_constraint_violation 40002 is a catalogue-defined transaction-integrity condition. No distinct PostgreSQL core 40002 call site was resolved in the fixed scan used for this batch, so no foreign-key, unique, or other concrete constraint error is relabeled as this umbrella… | 9.0 – 20 |
40003Class 40 · Transaction Rollback statement_completion_unknown 40003 describes uncertainty about statement completion, generally a reconciliation problem at a connection or protocol boundary. The fixed core scan did not provide a safe SQL-only natural trigger for this batch. A client timeout or a fabricated RAI… | 9.0 – 20 |
40P01Class 40 · Transaction Rollback deadlock_detected 40P01 is PostgreSQL's deadlockdetected condition in Class 40, transactionrollback. It means that the lock manager found a cycle in which transactions are waiting for one another, so PostgreSQL chose a victim and aborted its transaction. | 9.0 – 20 |
42000Class 42 · Syntax Error or Access Rule Violation syntax_error_or_access_rule_violation SQLSTATE 42000 is syntax_error_or_access_rule_violation in Class 42. 42000 is the broad syntax-error-or-access-rule umbrella. This batch keeps it as a definition boundary because fixed PostgreSQL paths report concrete child codes such as 42501 and 4… | 9.0 – 20 |
42501Class 42 · Syntax Error or Access Rule Violation insufficient_privilege SQLSTATE 42501 is insufficient_privilege in Class 42. 42501 is insufficient privilege. The selected natural path calls nextval on a runner-owned sequence from a separate role that has schema USAGE but no sequence USAGE; PostgreSQL reports permission… | 9.0 – 20 |
42601Class 42 · Syntax Error or Access Rule Violation syntax_error SQLSTATE 42601 is syntax_error in Class 42. 42601 is a syntax error. The selected parser path rejects LIMIT 1, 2 with primary LIMIT #,# syntax is not supported and hint Use separate LIMIT and OFFSET clauses. | 9.0 – 20 |
42602Class 42 · Syntax Error or Access Rule Violation invalid_name SQLSTATE 42602 is invalid_name in Class 42. 42602 is an invalid name. The selected enum path rejects a 64-byte label with primary invalid enum label "%s" and a length detail; a short label can be added afterwards. | 9.0 – 20 |
42611Class 42 · Syntax Error or Access Rule Violation invalid_column_definition SQLSTATE 42611 is invalid_column_definition in Class 42. 42611 is an invalid column definition. Two inherited parents in the selected case define different defaults for id; the child definition fails with column "%s" inherits conflicting default val… | 9.0 – 20 |
42622Class 42 · Syntax Error or Access Rule Violation name_too_long SQLSTATE 42622 is name_too_long in Class 42. 42622 is nametoolong. Fixed source paths include a scanner NOTICE for an overlong SQL identifier and a binary name receive ERROR; ordinary text input can truncate without either diagnostic. | 9.0 – 20 |
42701Class 42 · Syntax Error or Access Rule Violation duplicate_column SQLSTATE 42701 is duplicate_column in Class 42. 42701 is duplicate_column. The selected CREATE TABLE path lists id twice and reports column "%s" specified more than once before a repaired table with distinct columns is created. | 9.0 – 20 |
42702Class 42 · Syntax Error or Access Rule Violation ambiguous_column SQLSTATE 42702 is ambiguous_column in Class 42. 42702 is ambiguous_column. The selected join exposes id from two real tables and an unqualified SELECT id reports column reference "%s" is ambiguous. | 9.0 – 20 |
42703Class 42 · Syntax Error or Access Rule Violation undefined_column SQLSTATE 42703 is undefined_column in Class 42. 42703 is undefinedcolumn. The selected query names missingcolumn on a real table and reports column "%s" does not exist; selecting the defined id then succeeds. | 9.0 – 20 |
42704Class 42 · Syntax Error or Access Rule Violation undefined_object SQLSTATE 42704 is undefined_object in Class 42. 42704 is undefined_object. The selected DROP TRIGGER path names a trigger absent from a real table and reports trigger "%s" for table "%s" does not exist; a real trigger can then be created and dropped. | 9.0 – 20 |
42710Class 42 · Syntax Error or Access Rule Violation duplicate_object 42710 is duplicate_object: a definition collides with an occupied object name. The selected path is a second CREATE TYPE ... AS ENUM; the same SQLSTATE is reused by other object-definition paths, so first identify the object kind and schema. | 9.0 – 20 |
42712Class 42 · Syntax Error or Access Rule Violation duplicate_alias 42712 is duplicate_alias: a query namespace assigns the same table alias more than once. The parser rejects two VALUES range-table entries named duplicate_alias. | 9.0 – 20 |
42723Class 42 · Syntax Error or Access Rule Violation duplicate_function 42723 is duplicate_function: a function definition repeats the same schema, name, and input argument types. Output types do not create another overload. | 9.0 – 20 |
42725Class 42 · Syntax Error or Access Rule Violation ambiguous_function 42725 is ambiguous_function: lookup found multiple viable candidates but no best one. The case defines uuid and jsonb overloads and passes an unknown string literal. | 9.0 – 20 |
42803Class 42 · Syntax Error or Access Rule Violation grouping_error 42803 is grouping_error: a grouped query projects a value that is neither grouped nor aggregated. The case groups category while selecting label. | 9.0 – 20 |
42804Class 42 · Syntax Error or Access Rule Violation datatype_mismatch 42804 is datatype_mismatch: an expression or definition has a type different from its target context. The selected path rejects a text default for an integer column. | 9.0 – 20 |
42809Class 42 · Syntax Error or Access Rule Violation wrong_object_type 42809 is wrong_object_type: a command is valid in general but not for the selected object kind. The case tries a row-level BEFORE trigger on a view. | 9.0 – 20 |
42830Class 42 · Syntax Error or Access Rule Violation invalid_foreign_key 42830 is invalid_foreign_key: an FK definition cannot find a qualifying unique key on referenced columns. The case references a parent integer column with no unique constraint. | 9.0 – 20 |
42846Class 42 · Syntax Error or Access Rule Violation cannot_coerce 42846 is cannot_coerce: no applicable cast connects the source and target types. The selected expression asks for integer to date. | 9.0 – 20 |
42883Class 42 · Syntax Error or Access Rule Violation undefined_function 42883 is undefined_function: lookup found no compatible function for the requested name and input types. The same condition is also used by the parser's undefined-operator branch. The case calls a schema-qualified integer function signature before i… | 9.0 – 20 |
428C9Class 42 · Syntax Error or Access Rule Violation generated_always 428C9 (generated_always) is a rewrite-stage ERROR when an INSERT or UPDATE supplies a value where PostgreSQL must generate it or receive DEFAULT. Identity columns and generated columns follow different assignment rules, so the operation and column m… | 10 – 20 |
42939Class 42 · Syntax Error or Access Rule Violation reserved_name 42939 (reserved_name) rejects a name under an object-specific PostgreSQL rule. The selected 18.6 paths cover schemas, tablespaces, role creation, and role-specification grammar; the object named in the message determines which rule fired. | 9.0 – 20 |
42P01Class 42 · Syntax Error or Access Rule Violation undefined_table 42P01 is PostgreSQL's undefinedtable condition in Class 42, syntaxerrororaccessruleviolation. The name is historical: the failing reference can be a table, view, materialized view, foreign table, or another relation name that the parser cannot resol… | 9.0 – 20 |
42P02Class 42 · Syntax Error or Access Rule Violation undefined_parameter 42P02 (undefined_parameter) is a parse-time ERROR because a positional marker such as $1 is outside the parameter set known to parse analysis. It differs from a Bind-message count violation (08P01) and from 42P08, where a known parameter cannot rece… | 9.0 – 20 |
42P03Class 42 · Syntax Error or Access Rule Violation duplicate_cursor 42P03 (duplicate_cursor) reports a cursor/portal name collision, but the same SQLSTATE covers an ERROR, a replacement WARNING, and a PL/pgSQL-specific active-cursor ERROR. The caller and the CreatePortal options determine which behavior occurred. | 9.0 – 20 |
42P04Class 42 · Syntax Error or Access Rule Violation duplicate_database 42P04 (duplicate_database) means a database-management path found the requested name already in the cluster. It is a cluster-level name check, not a relation collision in the current database, and the CREATE and RENAME callers have different surroun… | 9.0 – 20 |
42P05Class 42 · Syntax Error or Access Rule Violation duplicate_prepared_statement 42P05 (duplicate_prepared_statement) means the current backend/session already has a named prepared statement with that name. Pool reuse can expose this state from an earlier request, while a different connection can have a separate statement of the… | 9.0 – 20 |
42P06Class 42 · Syntax Error or Access Rule Violation duplicate_schema 42P06 (duplicate_schema) is a schema-definition collision. Plain CREATE SCHEMA errors; IF NOT EXISTS can emit NOTICE and continue, but that conditional path only skips creation and does not reconcile the existing schema. | 9.0 – 20 |
42P07Class 42 · Syntax Error or Access Rule Violation duplicate_table 42P07 (duplicate_table) covers relation-name collisions, conditional skips, and inheritance graph checks. Identify the operation before repairing it. | 9.0 – 20 |
42P08Class 42 · Syntax Error or Access Rule Violation ambiguous_parameter 42P08 (ambiguous_parameter) means a parameter marker exists, but parse analysis cannot make its type consistent or specific enough. The exact SQLSTATE and parser branch matter because similar primary text can be emitted by a different condition. | 9.0 – 20 |
42P09Class 42 · Syntax Error or Access Rule Violation ambiguous_alias 42P09 (ambiguous_alias) is a parser ERROR when one visible table reference resolves to more than one relation namespace item. It occurs before execution and has separate named-alias and relation-OID paths. | 9.0 – 20 |
42P10Class 42 · Syntax Error or Access Rule Violation invalid_column_reference 42P10 (invalid_column_reference) Column references can be rejected by the operation that consumes them. | 9.0 – 20 |
42P11Class 42 · Syntax Error or Access Rule Violation invalid_cursor_definition 42P11 (invalid_cursor_definition) Cursor options and cursor plans have definition-time constraints. | 9.0 – 20 |
42P12Class 42 · Syntax Error or Access Rule Violation invalid_database_definition 42P12 (invalid_database_definition) This condition names an invalid database definition, but its core emitter was not resolved in this scan. | 9.0 – 20 |
42P13Class 42 · Syntax Error or Access Rule Violation invalid_function_definition 42P13 (invalid_function_definition) Function, aggregate, and trigger declarations can fail validation before execution. | 9.0 – 20 |
42P14Class 42 · Syntax Error or Access Rule Violation invalid_prepared_statement_definition 42P14 (invalid_prepared_statement_definition) A PREPARE command can fail while defining the prepared statement itself. | 9.0 – 20 |
42P15Class 42 · Syntax Error or Access Rule Violation invalid_schema_definition 42P15 (invalid_schema_definition) CREATE SCHEMA can be rejected when its schema declarations disagree. | 9.0 – 20 |
42P16Class 42 · Syntax Error or Access Rule Violation invalid_table_definition 42P16 (invalid_table_definition) A table definition can violate partition-key, collation, or primary-key rules. | 9.0 – 20 |
42P17Class 42 · Syntax Error or Access Rule Violation invalid_object_definition 42P17 (invalid_object_definition) Object definitions can conflict through inheritance, generated columns, or rewrite rules. | 9.0 – 20 |
42P18Class 42 · Syntax Error or Access Rule Violation indeterminate_datatype 42P18 (indeterminate_datatype) Type inference fails when an expression or protocol parameter has no determinate type. | 9.0 – 20 |
42P19Class 42 · Syntax Error or Access Rule Violation invalid_recursion 42P19 (invalid_recursion) Recursive query structure is checked before the recursive term can run. | 9.0 – 20 |
42P20Class 42 · Syntax Error or Access Rule Violation windowing_error 42P20 (windowing_error) Window definitions constrain both calls and frame boundaries. | 9.0 – 20 |
42P21Class 42 · Syntax Error or Access Rule Violation collation_mismatch 42P21 (collation_mismatch) Different collation choices meet where PostgreSQL requires one compatible result. | 9.1 – 20 |
42P22Class 42 · Syntax Error or Access Rule Violation indeterminate_collation 42P22 (indeterminate_collation) An operation that needs one collation has no unambiguous collation to use. | 9.1 – 20 |
44000Class 44 · WITH CHECK OPTION Violation with_check_option_violation 44000 means that a row written through a view would not satisfy that view's WITH CHECK OPTION predicate. It protects the view's write invariant; it is not the table-level CHECK condition 23514. | 9.0 – 20 |
53000Class 53 · Insufficient Resources insufficient_resources 53000 is the broad insufficient-resources condition. Fixed 18.6 callers include background-worker startup, local-buffer exhaustion, and file-descriptor limits, so the message and startup/runtime phase identify the resource. | 9.0 – 20 |
53100Class 53 · Insufficient Resources disk_full 53100 reports the explicit short-write branch of a file write. Fixed paths cover base-backup output and relation-file extension; the diagnostic names the file, partial byte count, requested count, and offset or block. | 9.0 – 20 |
53200Class 53 · Insufficient Resources out_of_memory 53200 is PostgreSQL's out-of-memory condition. Fixed callers include ordinary memory-context allocation, shared-memory and lock-table capacity, extension/statistics-file loading, and WAL-reading processors. The useful diagnosis is the operation and … | 9.0 – 20 |
53300Class 53 · Insufficient Resources too_many_connections 53300 is PostgreSQL's toomanyconnections condition in Class 53, insufficient_resources. It is emitted when a new backend cannot be admitted because a connection capacity limit has been reached. The representative case uses a role connection limit of… | 9.0 – 20 |
53400Class 53 · Insufficient Resources configuration_limit_exceeded 53400 reports that a configured or finite process slot is exhausted. Fixed paths cover background workers, logical-replication workers, and replication-origin state slots. | 9.2 – 20 |
54000Class 54 · Program Limit Exceeded program_limit_exceeded 54000 is used when a concrete program, representation, or extension limit is exceeded. Fixed examples include safe allocation-size arithmetic, relation block numbering, array dimensions/size, cube dimensions, and hstore pair counts; the source path … | 9.0 – 20 |
54001Class 54 · Program Limit Exceeded statement_too_complex 54001 covers a statement that exceeds a planner, parser, or execution-stack limit. Fixed paths include the 4096 grouping-set ceiling and maxstackdepth enforcement. | 9.0 – 20 |
54011Class 54 · Program Limit Exceeded too_many_columns 54011 reports that a physical tuple descriptor or a related object definition exceeds its fixed column limit. The source path determines whether the count is for table attributes, index keys plus INCLUDE columns, partition keys, statistics dimension… | 9.0 – 20 |
54023Class 54 · Program Limit Exceeded too_many_arguments 54023 is the argument-count limit for functions, procedures, aggregates, and set-returning calls. Fixed paths protect catalog arrays, parser nodes, and executor FunctionCallInfo storage, and report the actual compile-time limit with plural-aware mes… | 9.0 – 20 |
55000Class 55 · Object Not In Prerequisite State object_not_in_prerequisite_state 55000 means the requested operation lacks a required object or server state. This page selects the session-local sequence prerequisite behind currval; preload, recovery, and invalid-index paths are separate mechanisms. | 9.0 – 20 |
55006Class 55 · Object Not In Prerequisite State object_in_use 55006 reports that the requested object operation conflicts with active use. This page selects a same-session cursor holding a table in an explicit transaction; database users, logical replication, and pending trigger-event branches are distinct. | 9.0 – 20 |
55P02Class 55 · Object Not In Prerequisite State cant_change_runtime_param 55P02 means that PostgreSQL rejected a runtime-parameter change because the GUC context or lifecycle phase does not permit that operation. The same condition name covers restart-only, SIGHUP-only, backend-start, internal, and binary-upgrade guards. | 9.0 – 20 |
55P03Class 55 · Object Not In Prerequisite State lock_not_available 55P03 reports that a requested lock could not be obtained under the operation's selected wait policy. Fixed paths cover row locks, relation locks, LOCK TABLE, lock_timeout, and maintenance commands that skip work. | 9.0 – 20 |
55P04Class 55 · Object Not In Prerequisite State unsafe_new_enum_value_usage 55P04 protects the commit-before-use rule for a newly added enum value. It is raised after PostgreSQL has found an enum tuple that is still uncommitted and marked as unsafe, not because the label has invalid syntax. | 12 – 20 |
57000Class 57 · Operator Intervention operator_intervention 57000 is the SQLSTATE Class 57 condition operator_intervention. The fixed 18.6 definition is present, but the bounded report/call scan did not resolve a core emitting call for this exact code. The page therefore keeps the mechanism, message, severit… | 9.0 – 20 |
57014Class 57 · Operator Intervention query_canceled 57014 is PostgreSQL's querycanceled condition in Class 57, operatorintervention. It indicates that the server interrupted a statement. The same SQLSTATE covers several cancellation sources, so the primary message and server context are needed to dis… | 9.0 – 20 |
57P01Class 57 · Operator Intervention admin_shutdown 57P01 is a server-initiated administrative-shutdown condition. Fixed core paths cover orderly or immediate client termination, worker/parallel termination, and a synchronous-replication wait that explicitly says the transaction has already committed… | 9.0 – 20 |
57P02Class 57 · Operator Intervention crash_shutdown 57P02 is the crash-shutdown path. When a crash-and-restart cycle is in progress, the backend sends a client-only WARNING describing the postmaster command to roll back and exit, then exits without running normal cleanup callbacks because shared memo… | 9.0 – 20 |
57P03Class 57 · Operator Intervention cannot_connect_now 57P03 is emitted during connection startup when the database has not reached a connection-ready state. Fixed guards distinguish startup, shutdown, recovery, disabled hot standby, and two different not-yet-consistent recovery states. | 9.0 – 20 |
57P04Class 57 · Operator Intervention database_dropped 57P04 is selected when a recovery conflict terminates a session because the connected database must be dropped. The same recovery-conflict primary is used for other conflict reasons, but those branches select 40001; the database-dropped guard is the… | 9.0 – 20 |
57P05Class 57 · Operator Intervention idle_session_timeout 57P05 terminates a session after idlesessiontimeout expires while the backend is truly idle between commands. The fixed code starts this timer only in the no-transaction branch; idle-in-transaction has a separate condition and timer. | 14 – 20 |
58000Class 58 · System Error (errors external to PostgreSQL itself) system_error 58000 is the system-error condition. In the fixed backend path, pg_promote creates the promotion signal file and then calls kill(PostmasterPid, SIGUSR1); a failed signal reports ERROR with the operating-system text substituted for %m. | 9.2 – 20 |
58030Class 58 · System Error (errors external to PostgreSQL itself) io_error 58030 is emitted by a specific shared-buffer cleanup path after a write failure has already been recorded. In PostgreSQL 18.6 that path reports WARNING, not a generic client ERROR: it names the block and relation and says that repeated failure may b… | 9.0 – 20 |
58P01Class 58 · System Error (errors external to PostgreSQL itself) undefined_file 58P01 means that a required file or directory could not be found. In the fixed tablespace path, PostgreSQL distinguishes an ENOENT target during chmod from other permission or filesystem failures; the recovery hint is conditional on the server being… | 9.0 – 20 |
58P02Class 58 · System Error (errors external to PostgreSQL itself) duplicate_file 58P02 is the duplicate-file condition in the fixed server-side base-backup output path. The path accepts a missing directory, accepts an existing empty directory, and raises this code when the existing target is non-empty. | 9.0 – 20 |
58P03Class 58 · System Error (errors external to PostgreSQL itself) file_name_too_long 58P03 is selected by PostgreSQL's file-access errno helper when the saved OS errno is ENAMETOOLONG. It is not a standalone fixed primary such as file name too long: the caller supplies a %m message, and the helper supplies the SQLSTATE. | 18 – 20 |
72000Class 72 · Snapshot Failure snapshot_too_old 72000 is a historical snapshottooold error. PostgreSQL 16.15 still defines and emits it; the SQLSTATE was removed in the PostgreSQL 17 major line. PostgreSQL 16.15 is therefore a later minor snapshot of the last major line, not the removal point. | 9.6 – 16 · No PG 18 snapshot |
F0000Class F0 · Configuration File Error config_file_error F0000 is the configuration-file error condition, but its severity and recovery boundary depend on the owner. Fixed core paths include a recovery-target failure and OAuth HBA validation; the unaccent contrib dictionary has its own file-open and rule-… | 9.0 – 20 |
F0001Class F0 · Configuration File Error lock_file_exists F0001 is a startup ownership failure. PostgreSQL checks both the lock file and the shared-memory identity for the intended data directory; a live owner is different from a stale artifact left by a crashed postmaster. | 9.0 – 20 |
HV000Class HV · Foreign Data Wrapper Error (SQL/MED) fdw_error HV000 is the generic SQL/MED foreign-data-wrapper error condition. It identifies the FDW error class, not a particular remote failure, callback, or retry policy. No direct ERRCODEFDWERROR report group was resolved in the PostgreSQL 18.6 core/contrib… | 9.1 – 20 |
HV001Class HV · Foreign Data Wrapper Error (SQL/MED) fdw_out_of_memory HV001 is the SQL/MED condition for an FDW-side out-of-memory failure. In PostgreSQL 18.6, the bundled postgresfdw and dblink implementations use it when PQconndefaults() returns no option array, and postgresfdw also uses it when its option copy cann… | 9.1 – 20 |
HV002Class HV · Foreign Data Wrapper Error (SQL/MED) fdw_dynamic_parameter_value_needed HV002 says that an FDW operation needs a parameter value that was not available. PostgreSQL 18.6's bundled file_fdw validator raises it during foreign-table option validation when neither filename nor program is supplied. | 9.1 – 20 |
HV004Class HV · Foreign Data Wrapper Error (SQL/MED) fdw_invalid_data_type HV004 is the SQL/MED condition for a foreign-data-wrapper data type that cannot be used for the requested operation. The 18.6 core/contrib call scan found no resolved direct HV004 report group, so this page does not claim a particular bundled messag… | 9.1 – 20 |
HV005Class HV · Foreign Data Wrapper Error (SQL/MED) fdw_column_name_not_found HV005 is the SQL/MED condition for a foreign column name that the wrapper cannot find in the relevant remote or imported descriptor. No direct HV005 report group was resolved in the PostgreSQL 18.6 core/contrib scan, so the concrete remote system an… | 9.1 – 20 |
HV006Class HV · Foreign Data Wrapper Error (SQL/MED) fdw_invalid_data_type_descriptors HV006 covers invalid data-type descriptor information at an FDW boundary. PostgreSQL 18.6 defines it but the core/contrib call scan resolved no direct report group, so no bundled wrapper message or natural SQL reproduction is claimed. | 9.1 – 20 |
HV007Class HV · Foreign Data Wrapper Error (SQL/MED) fdw_invalid_column_name HV007 is an FDW-specific invalid-column-name condition. The 18.6 core/contrib scan found no direct report group, so the wrapper that validates the name and its message must be identified from the actual deployment. | 9.1 – 20 |
HV008Class HV · Foreign Data Wrapper Error (SQL/MED) fdw_invalid_column_number HV008 identifies an invalid column number (ordinal) in an FDW descriptor or callback. PostgreSQL 18.6 defines it, but its core/contrib call scan found no direct report group or bundled message. | 9.1 – 20 |
HV009Class HV · Foreign Data Wrapper Error (SQL/MED) fdw_invalid_use_of_null_pointer HV009 describes an invalid null-pointer use at the FDW boundary. The PostgreSQL 18.6 core/contrib scan found no direct resolved report group, so no safe SQL reproduction or bundled message is claimed. | 9.1 – 20 |
HV00AClass HV · Foreign Data Wrapper Error (SQL/MED) fdw_invalid_string_format HV00A is the SQL/MED condition for an invalid string format at an FDW boundary. PostgreSQL 18.6's core/contrib call scan found no resolved direct report group, so the format grammar and message must come from the installed wrapper or remote driver. | 9.1 – 20 |
HV00BClass HV · Foreign Data Wrapper Error (SQL/MED) fdw_invalid_handle HV00B names an invalid FDW handle: a wrapper received a handle that is unknown, closed, or invalid for the current operation. The PostgreSQL 18.6 core/contrib call scan has no resolved direct HV00B report group, so the handle type and message are im… | 9.1 – 20 |
HV00CClass HV · Foreign Data Wrapper Error (SQL/MED) fdw_invalid_option_index HV00C identifies an option index that is invalid for the FDW option collection in use. No direct HV00C report group was resolved in the PostgreSQL 18.6 core/contrib scan, so no specific option array or message is attributed. | 9.1 – 20 |
HV00DClass HV · Foreign Data Wrapper Error (SQL/MED) fdw_invalid_option_name HV00D is raised when an FDW option name is not valid in the current wrapper context. PostgreSQL 18.6 has direct paths in filefdw, postgresfdw, and the postgres_fdw import option parser. | 9.1 – 20 |
HV00JClass HV · Foreign Data Wrapper Error (SQL/MED) fdw_option_name_not_found HV00J is used by dblink's connection-option validation when an option name is not in the accepted dblink/libpq option set. dblink is a separate contrib client API, not an FDW callback implementation. The 18.6 core/contrib scan found no other resolve… | 9.1 – 20 |
HV00KClass HV · Foreign Data Wrapper Error (SQL/MED) fdw_reply_handle HV00K is the SQL/MED reply-handle condition. PostgreSQL 18.6 defines it, but the locked core/contrib scan has no direct resolved HV00K report group; the condition does not by itself say whether a reply handle is missing, stale, or otherwise unusable. | 9.1 – 20 |
HV00LClass HV · Foreign Data Wrapper Error (SQL/MED) fdw_unable_to_create_execution HV00L denotes an FDW implementation's inability to create a remote execution object. No direct 18.6 core/contrib report group was resolved, so the object, remote API, and message are wrapper-specific. | 9.1 – 20 |
HV00MClass HV · Foreign Data Wrapper Error (SQL/MED) fdw_unable_to_create_reply HV00M denotes failure to create an FDW reply object or result channel. The PostgreSQL 18.6 core/contrib scan has no direct resolved report group; the exact object and driver boundary must be read from the installed wrapper. | 9.1 – 20 |
HV00NClass HV · Foreign Data Wrapper Error (SQL/MED) fdw_unable_to_establish_connection HV00N is the SQL/MED condition for an FDW unable to establish its connection. No direct 18.6 core/contrib HV00N report group was resolved. Do not use the condition name to choose between DNS, authentication, TLS, network, or remote-server causes. | 9.1 – 20 |
HV00PClass HV · Foreign Data Wrapper Error (SQL/MED) fdw_no_schemas HV00P is raised by the core IMPORT FOREIGN SCHEMA command when the selected FDW has no ImportForeignSchema callback. It means the wrapper does not support that import mechanism, not that a remote schema is empty. | 9.1 – 20 |
HV00QClass HV · Foreign Data Wrapper Error (SQL/MED) fdw_schema_not_found HV00Q is a concrete postgresfdw import error. Its remote connection runs an exact pgcatalog.pg_namespace lookup for the requested nspname; when the result count is not exactly one, the wrapper reports the remote schema by name. | 9.1 – 20 |
HV00RClass HV · Foreign Data Wrapper Error (SQL/MED) fdw_table_not_found HV00R identifies a table-not-found condition in the FDW class. The locked PostgreSQL 18.6 core/contrib call scan has no resolved HV00R report group, so it does not identify a core emitter, remote catalog, or message template. | 9.1 – 20 |
HV010Class HV · Foreign Data Wrapper Error (SQL/MED) fdw_function_sequence_error HV010 indicates that an FDW function was called in an invalid sequence. The fixed 18.6 core/contrib call scan has no resolved HV010 report group, so it does not establish a native callback or message. | 9.1 – 20 |
HV014Class HV · Foreign Data Wrapper Error (SQL/MED) fdw_too_many_handles HV014 identifies an FDW condition involving too many handles. No resolved HV014 report group was found in the locked PostgreSQL 18.6 core/contrib call scan, so no native handle limit or message is attributed. | 9.1 – 20 |
HV021Class HV · Foreign Data Wrapper Error (SQL/MED) fdw_inconsistent_descriptor_information HV021 identifies inconsistent information in an FDW descriptor. The 18.6 core/contrib call scan has no resolved HV021 report group, so it does not identify a core descriptor check or message. | 9.1 – 20 |
HV024Class HV · Foreign Data Wrapper Error (SQL/MED) fdw_invalid_attribute_value HV024 identifies an attribute value that an FDW boundary rejects. No resolved HV024 report group was found in the locked PostgreSQL 18.6 core/contrib call scan, so no particular attribute or message is confirmed. | 9.1 – 20 |
HV090Class HV · Foreign Data Wrapper Error (SQL/MED) fdw_invalid_string_length_or_buffer_length HV090 identifies an invalid string length or buffer length at an FDW boundary. The locked 18.6 core/contrib call scan has no resolved HV090 report group, so it does not establish a native buffer check or message. | 9.1 – 20 |
HV091Class HV · Foreign Data Wrapper Error (SQL/MED) fdw_invalid_descriptor_field_identifier HV091 identifies a descriptor field identifier that an FDW boundary cannot use. No resolved HV091 report group was found in the locked PostgreSQL 18.6 core/contrib call scan, so no particular descriptor namespace or message is confirmed. | 9.1 – 20 |
P0000Class P0 · PL/pgSQL Error plpgsql_error P0000 is the PL/pgSQL Error category entry. The bounded PostgreSQL 18.6 call archive has no resolved report group for the category code itself, so member-code paths remain separate. | 9.0 – 20 |
P0001Class P0 · PL/pgSQL Error raise_exception P0001 is the raise_exception condition in PostgreSQL's PL/pgSQL-specific Class P0. A RAISE EXCEPTION statement with no condition name and no explicit SQLSTATE defaults to this code. The message is supplied by the function author, so P0001 is usually… | 9.0 – 20 |
P0002Class P0 · PL/pgSQL Error no_data_found P0002 is PL/pgSQL nodatafound. Fixed paths include the strict-query ERROR text and a separate tablespace NOTICE path; it does not mean every SELECT returning zero rows. | 9.0 – 20 |
P0003Class P0 · PL/pgSQL Error too_many_rows P0003 is PL/pgSQL toomanyrows. Fixed paths preserve the message, optional parameter detail, hint, and the source-selected severity boundary. | 9.0 – 20 |
P0004Class P0 · PL/pgSQL Error assert_failure P0004 is PL/pgSQL assert_failure. The fixed ASSERT path reports ERROR with either the evaluated message or assertion failed. | 9.5 – 20 |
XX000Class XX · Internal Error internal_error XX000 is the internal_error condition in Class XX, Internal Error. The PostgreSQL source directory describes this class as covering “can't-happen” conditions and software bugs. It is a generic diagnostic boundary, not a claim that a database is corr… | 9.0 – 20 |
XX001Class XX · Internal Error data_corrupted XX001 reports an integrity invariant failure. The fixed sources cover corrupted PGLZ TOAST data, impossible MultiXact/XID freeze state in heap processing, and an amcheck B-tree check that can reveal a heap/HOT-chain problem behind an apparent index … | 9.0 – 20 |
XX002Class XX · Internal Error index_corrupted XX002 reports an index-structure failure. The fixed sources are method-specific: BRIN checks a range-map pointer, while GiST and hash check page headers, special areas, and method-specific metadata. | 9.0 – 20 |