↑↓ select↵ open⌫ change scopeOpen full search

PG.CENTER connects PostgreSQL documentation, reference, and ecosystem knowledge. Maintained by Pigsty.

Wiki / SQLSTATE

Definitions for PostgreSQL 18

English manual coverage begins with PostgreSQL 8.1. Source history and runtime observations have their own recorded version boundaries.

Reading PG 18·Select a recorded version

262 / 262 recorded definitionsA filled square means the entry is documented in that version. Select one to read it there.
  • 00000008.1 – 20

    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.

  • 01000018.1 – 20

    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.

  • 01003018.1 – 20

    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.

  • 01004018.1 – 20

    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.

  • 01006018.1 – 20

    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.

  • 01007018.1 – 20

    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.

  • 01008018.1 – 20

    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.

  • 0100C018.1 – 20

    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.

  • 01P01018.1 – 20

    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.

  • 02000028.1 – 20

    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 client error.

  • 02001028.1 – 20

    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.

  • 03000038.1 – 20

    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.

  • 08000088.1 – 20

    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 refused client socket is not enough to claim this code.

  • 08001088.1 – 20

    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 connection and the refused-port reason is dynamic DETAIL; this differs from 08003 (an absent dblink handle) and startup failures such as 28000, 28P01, and 3D000.

  • 08003088.1 – 20

    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 established socket failed (08006). The selected path first disconnects missing_remote, then proves a real handle can be opened, queried, and disconnected.

  • 08004088.1 – 20

    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 ereport path for this code.

  • 08006088.1 – 20

    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, and this batch intentionally has no generic socket run.

  • 08007088.1 – 20

    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.

  • 08P01088.1 – 20

    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 valid frame, receives C=08P01, S=FATAL, primary invalid frontend message type 89, and reads server EOF before the client closes the socket.

  • 09000098.1 – 20

    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. The code is therefore tied to those installed trigger functions and their table/trigger configuration; it is not a label for every trigger failure.

  • 0A0000A8.1 – 20

    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, then accepts the same index without ordering. This is an access-method capability decision, not 42501 privilege denial or 42601 parser failure.

  • 0B0000B8.1 – 20

    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 class as an identity and investigation starting point, not as proof that a particular BEGIN, savepoint, or client command emits it.

  • 0F0000F8.1 – 20

    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 layer, extension, or remote implementation can still expose this standard class, so the observed producer must be identified before applying locator-specific advice.

  • 0F0010F8.1 – 20

    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 name into a claim about PostgreSQL large objects, cursors, FDW handles, or a particular driver API.

  • 0L0000L8.1 – 20

    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 bootstrap or ACL-initialization phase and not the ordinary “permission denied” or invalid GRANT-operation path.

  • 0LP010L8.1 – 20

    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 invalid privilege type INSERT for sequence; granting USAGE then succeeds.

  • 0P0000P8.1 – 20

    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 ErrorResponse.

  • 0Z0000Z9.2 – 20

    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 keep the member code and its message for diagnosis.

  • 0Z0020Z9.2 – 20

    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 RAISE without parameters cannot be used outside an exception handler, both reported at ERROR level.

  • 106081018 – 20

    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 reference the macro, but those references alone do not establish an additional report message.

    8.18.28.38.49.09.19.29.39.49.59.61011121314151617181920
  • 20000208.4 – 20

    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; it is not the result of an ordinary query returning zero rows.

  • 21000218.1 – 20

    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.

  • 22000228.1 – 20

    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.

  • 22001228.1 – 20

    22001 is stringdataright_truncation. The fixed varchar path reports the declared character width, while hstore and varbit have separate variants.

  • 22002228.1 – 20

    22002 is nullvaluenoindicatorparameter, an ECPG-oriented condition. The fixed 18.6 call archive has no resolved native report group in this scan.

  • 22003228.1 – 20

    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.

  • 22004228.1 – 20

    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.

  • 22005228.1 – 20

    22005 is errorinassignment. The fixed PL/pgSQL path reports assignment to a variable declared CONSTANT; ECPG and other assignment layers may have separate boundaries.

  • 22007228.1 – 20

    22007 is invaliddatetimeformat. The fixed interval-formatting path reports an invalid format specification and explains that intervals are not tied to specific calendar dates.

  • 22008228.1 – 20

    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.

  • 22009228.1 – 20

    22009 is invalidtimezonedisplacementvalue. The fixed timetz_recv binary-input path rejects a GMT displacement outside the supported range.

  • 2200B228.1 – 20

    2200B is escapecharacterconflict. The fixed 18.6 call archive has no resolved native report group in this scan.

  • 2200C228.1 – 20

    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 about the SQL-to-POSIX translation syntax, not generic POSIX backslash escaping.

  • 2200D228.1 – 20

    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.

  • 2200F228.1 – 20

    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 output length raises output cannot be empty string. A separate core arraytotsvector path rejects an empty lexeme, so the message and function matter.

  • 2200G228.1 – 20

    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.

  • 2200H2210 – 20

    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 uses the C PRId64 format macro, so the source spelling is nextval: reached maximum value of sequence "%s" (%" PRId64 ") (and the corresponding minimum form), not a literal (%s) placeholder. The limit is a sequence property, not a generic integer overflow.

    8.18.28.38.49.09.19.29.39.49.59.61011121314151617181920
  • 2200L228.3 – 20

    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 not an XML document. The wrapper’s early non-DOCUMENT/no-indent bypass is not a CONTENT-mode 2200L claim, and this entry does not cover every XML content or comment violation.

  • 2200M228.3 – 20

    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. These are distinct emitters from the 2200L document-option wrapper.

  • 2200N228.3 – 20

    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 2200M.

  • 2200S228.3 – 20

    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.

  • 2200T228.3 – 20

    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 DETAIL.

  • 22010228.1 – 20

    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 template, or severity.

  • 22011228.1 – 20

    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.

  • 22012228.1 – 20

    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.

  • 220132211 – 20

    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.

    8.18.28.38.49.09.19.29.39.49.59.61011121314151617181920
  • 22014228.4 – 20

    ntile received a non-positive bucket count. The fixed window-function path reports argument of ntile must be greater than zero with SQLSTATE 22014.

  • 22015228.1 – 20

    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.

  • 22016228.4 – 20

    nthvalue received a non-positive ordinal. The fixed window-function path reports argument of nthvalue must be greater than zero with SQLSTATE 22016.

  • 22018228.1 – 20

    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.

  • 22019228.1 – 20

    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.

  • 2201B228.1 – 20

    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 regex failure.

  • 2201E228.1 – 20

    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 handling NaN and infinities separately.

  • 2201F228.1 – 20

    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.

  • 2201G228.1 – 20

    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.

  • 2201W228.4 – 20

    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.

  • 2201X228.4 – 20

    An OFFSET expression is negative after evaluation. The fixed executor path reports OFFSET must not be negative.

  • 22021228.1 – 20

    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.

  • 22022228.1 – 20

    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.

  • 22023228.1 – 20

    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 checks; the primary text identifies the owner and value.

  • 22024228.1 – 20

    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.

  • 22025228.1 – 20

    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 length rule, and malformed \u/\U Unicode escapes.

  • 22026228.1 – 20

    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.

  • 22027228.1 – 20

    The trim operation rejected its argument or trim specification. No fixed PostgreSQL 18.6 emitting path was resolved in the bounded scan.

  • 2202E228.1 – 20

    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.

  • 2202G229.5 – 20

    The TABLESAMPLE REPEATABLE seed is invalid when it is NULL. The fixed executor path reports TABLESAMPLE REPEATABLE parameter cannot be null.

    8.18.28.38.49.09.19.29.39.49.59.61011121314151617181920
  • 2202H229.5 – 20

    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.

    8.18.28.38.49.09.19.29.39.49.59.61011121314151617181920
  • 220302212 – 20

    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.

    8.18.28.38.49.09.19.29.39.49.59.61011121314151617181920
  • 220312213 – 20

    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.

    8.18.28.38.49.09.19.29.39.49.59.61011121314151617181920
  • 220322212 – 20

    JSON text is invalid for the consuming operation. No fixed 18.6 emitting report group was resolved in the bounded scan.

    8.18.28.38.49.09.19.29.39.49.59.61011121314151617181920
  • 220332212 – 20

    A SQL/JSON array subscript is invalid. Fixed jsonpath paths distinguish out-of-bounds, non-single-numeric, and integer-range variants.

    8.18.28.38.49.09.19.29.39.49.59.61011121314151617181920
  • 220342212 – 20

    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.

    8.18.28.38.49.09.19.29.39.49.59.61011121314151617181920
  • 220352212 – 20

    A SQL/JSON path found no item for the requested operation. Fixed expression execution reports no SQL/JSON item found for specified path.

    8.18.28.38.49.09.19.29.39.49.59.61011121314151617181920
  • 220362212 – 20

    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 checks in .string().

    8.18.28.38.49.09.19.29.39.49.59.61011121314151617181920
  • 220372212 – 20

    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.

    8.18.28.38.49.09.19.29.39.49.59.61011121314151617181920
  • 220382212 – 20

    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 @@ operator have different default silent behavior.

    8.18.28.38.49.09.19.29.39.49.59.61011121314151617181920
  • 220392212 – 20

    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 22033.

    8.18.28.38.49.09.19.29.39.49.59.61011121314151617181920
  • 2203A2212 – 20

    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.

    8.18.28.38.49.09.19.29.39.49.59.61011121314151617181920
  • 2203B2212 – 20

    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.

    8.18.28.38.49.09.19.29.39.49.59.61011121314151617181920
  • 2203C2212 – 20

    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.

    8.18.28.38.49.09.19.29.39.49.59.61011121314151617181920
  • 2203D2212 – 20

    The locked condition names an excessive number of JSON array elements. No fixed PostgreSQL 18.6 emitting path was resolved in the bounded scan.

    8.18.28.38.49.09.19.29.39.49.59.61011121314151617181920
  • 2203E2212 – 20

    The locked condition names an excessive number of JSON object members. No fixed PostgreSQL 18.6 emitting path was resolved in the bounded scan.

    8.18.28.38.49.09.19.29.39.49.59.61011121314151617181920
  • 2203F2212 – 20

    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.

    8.18.28.38.49.09.19.29.39.49.59.61011121314151617181920
  • 2203G2215 – 20

    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 JSON conversion that merely looks similar is not evidence that the server used this SQLSTATE.

    8.18.28.38.49.09.19.29.39.49.59.61011121314151617181920
  • 22P01228.1 – 20

    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 result or an invalid operation such as division by zero.

  • 22P02228.1 – 20

    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.

  • 22P03228.1 – 20

    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 receive functions.

  • 22P04228.1 – 20

    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 that failed type conversion.

  • 22P05228.1 – 20

    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 in encoding "%s" at ERROR severity.

  • 22P06228.1 – 20

    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, and other escape use.

  • 23000238.1 – 20

    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.

  • 23001238.1 – 20

    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, so version and server diagnostics must be recorded. A separate PostgreSQL 17.11 comparison also returned 23503 for this RESTRICT operation; it is not 23001 coverage.

  • 23502238.1 – 20

    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.

  • 23503238.1 – 20

    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 18.6, the RESTRICT parent branch instead uses 23001, so classify the action and complete diagnostic before assigning this SQLSTATE.

  • 23505238.1 – 20

    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.

  • 23514238.1 – 20

    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.

  • 23P01239.0 – 20

    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.

  • 24000248.1 – 20

    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”.

  • 25000258.1 – 20

    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.

  • 25001258.1 – 20

    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 block.

  • 25002258.1 – 20

    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.

  • 25003258.1 – 20

    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.

  • 25004258.1 – 20

    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.

  • 25005258.1 – 20

    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.

  • 25006258.1 – 20

    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.

  • 25007258.1 – 20

    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.

  • 25008258.1 – 20

    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.

  • 25P01258.1 – 20

    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.

  • 25P02258.1 – 20

    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.

  • 25P03259.6 – 20

    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, not as a production recommendation.

    8.18.28.38.49.09.19.29.39.49.59.61011121314151617181920
  • 25P042517 – 20

    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 the setting is unavailable there, so it does not probe an unknown setting. A separate PG16.15/PG17.11 boundary comparison records unavailable-setting 42704 on PG16 and natural FATAL 25P04 on PG17; it is separate from the selected base case.

    8.18.28.38.49.09.19.29.39.49.59.61011121314151617181920
  • 26000268.1 – 20

    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.

  • 27000278.1 – 20

    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 to propagate changes to other rows. A naive self-updating BEFORE trigger can recurse or alter the trigger semantics, so this entry does not present it as a safe generic reproduction.

  • 28000288.1 – 20

    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>" does not exist before a session is established; other fixed authentication paths use this class for concrete certificate, pg_hba, and LOGIN eligibility failures.

  • 28P01289.0 – 20

    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 role's stored secret determine the precise path.

  • 2B0002B8.1 – 20

    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 DROP result as 2B000. For ordinary object dependencies, see 2BP01.

  • 2BP012B8.1 – 20

    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 retry the original operation.

  • 2D0002D8.1 – 20

    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-level transaction error is 2D000, and it does not fabricate a RAISE-based SQL example.

  • 2F0002F8.1 – 20

    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 routine-related investigation; it does not identify a particular function declaration, PL/pgSQL statement, or retry rule.

  • 2F0022F8.1 – 20

    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 scan has no native report group. Do not infer that PostgreSQL VOLATILE, STABLE, or IMMUTABLE alone maps to this SQLSTATE.

  • 2F0032F8.1 – 20

    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 proof that every prohibited SQL statement uses this code.

  • 2F0042F8.1 – 20

    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.

  • 2F0052F8.1 – 20

    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.

  • 34000348.1 – 20

    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 (24000).

  • 38000388.1 – 20

    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 under one category.

  • 38001388.1 – 20

    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.

  • 38002388.1 – 20

    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.

  • 38003388.1 – 20

    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.

  • 38004388.1 – 20

    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.

  • 39000398.1 – 20

    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 text matter.

  • 39001398.1 – 20

    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.

  • 39004398.1 – 20

    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.

  • 39P01398.1 – 20

    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.

  • 39P02398.1 – 20

    39P02 is srfprotocolviolated. The fixed executor path checks value-per-call and materialize set-returning-function contracts and reports the exact violated return mode.

  • 39P03399.5 – 20

    39P03 is eventtriggerprotocolviolated. Fixed event-trigger helpers reject calls outside their required sqldrop, table_rewrite, or event-trigger function context.

    8.18.28.38.49.09.19.29.39.49.59.61011121314151617181920
  • 3B0003B8.1 – 20

    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; this entry does not invent a class-level RAISE case.

  • 3B0013B8.1 – 20

    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.

  • 3D0003D8.1 – 20

    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 a missing database/template. The selected startup case reports C=3D000, S=FATAL, database "<generated>" does not exist; that is one phase, not the whole class.

  • 3F0003F8.1 – 20

    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 cover resolution during object creation and other SQL commands; it is not simply a search_path hint.

  • 40000408.1 – 20

    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 condition outside a safe SQL-only case. Do not turn a serialization failure, deadlock, or arbitrary client cancellation into 40000.

  • 40001408.1 – 20

    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 the client can retry.

  • 40002408.1 – 20

    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 code. Capture the actual SQLSTATE emitted by the operation.

  • 40003408.1 – 20

    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 RAISE is not proof of uncertain server completion: reconcile durable business state before retrying.

  • 40P01408.1 – 20

    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.

  • 42000428.1 – 20

    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 42601.

  • 42501428.1 – 20

    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 denied for sequence %s.

  • 42601428.1 – 20

    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.

  • 42602428.1 – 20

    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.

  • 42611428.1 – 20

    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 values and the hint to specify a default explicitly.

  • 42622428.1 – 20

    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.

  • 42701428.1 – 20

    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.

  • 42702428.1 – 20

    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.

  • 42703428.1 – 20

    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.

  • 42704428.1 – 20

    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.

  • 42710428.1 – 20

    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.

  • 42712428.1 – 20

    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.

  • 42723428.1 – 20

    42723 is duplicate_function: a function definition repeats the same schema, name, and input argument types. Output types do not create another overload.

  • 42725428.1 – 20

    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.

  • 42803428.1 – 20

    42803 is grouping_error: a grouped query projects a value that is neither grouped nor aggregated. The case groups category while selecting label.

  • 42804428.1 – 20

    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.

  • 42809428.1 – 20

    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.

  • 42830428.1 – 20

    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.

  • 42846428.1 – 20

    42846 is cannot_coerce: no applicable cast connects the source and target types. The selected expression asks for integer to date.

  • 42883428.1 – 20

    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 it exists.

  • 428C94210 – 20

    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 metadata matter.

    8.18.28.38.49.09.19.29.39.49.59.61011121314151617181920
  • 42939428.1 – 20

    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.

  • 42P01428.1 – 20

    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 resolve in the current namespace.

  • 42P02428.1 – 20

    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 receive a consistent type.

  • 42P03428.1 – 20

    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.

  • 42P04428.1 – 20

    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 surrounding guards.

  • 42P05428.1 – 20

    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 same name.

  • 42P06428.1 – 20

    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.

  • 42P07428.1 – 20

    42P07 (duplicate_table) covers relation-name collisions, conditional skips, and inheritance graph checks. Identify the operation before repairing it.

  • 42P08428.1 – 20

    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.

  • 42P09428.1 – 20

    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.

  • 42P10428.1 – 20

    42P10 (invalid_column_reference) Column references can be rejected by the operation that consumes them.

  • 42P11428.1 – 20

    42P11 (invalid_cursor_definition) Cursor options and cursor plans have definition-time constraints.

  • 42P12428.1 – 20

    42P12 (invalid_database_definition) This condition names an invalid database definition, but its core emitter was not resolved in this scan.

  • 42P13428.1 – 20

    42P13 (invalid_function_definition) Function, aggregate, and trigger declarations can fail validation before execution.

  • 42P14428.1 – 20

    42P14 (invalid_prepared_statement_definition) A PREPARE command can fail while defining the prepared statement itself.

  • 42P15428.1 – 20

    42P15 (invalid_schema_definition) CREATE SCHEMA can be rejected when its schema declarations disagree.

  • 42P16428.1 – 20

    42P16 (invalid_table_definition) A table definition can violate partition-key, collation, or primary-key rules.

  • 42P17428.1 – 20

    42P17 (invalid_object_definition) Object definitions can conflict through inheritance, generated columns, or rewrite rules.

  • 42P18428.1 – 20

    42P18 (indeterminate_datatype) Type inference fails when an expression or protocol parameter has no determinate type.

  • 42P19428.4 – 20

    42P19 (invalid_recursion) Recursive query structure is checked before the recursive term can run.

  • 42P20428.4 – 20

    42P20 (windowing_error) Window definitions constrain both calls and frame boundaries.

  • 42P21429.1 – 20

    42P21 (collation_mismatch) Different collation choices meet where PostgreSQL requires one compatible result.

  • 42P22429.1 – 20

    42P22 (indeterminate_collation) An operation that needs one collation has no unambiguous collation to use.

  • 44000448.1 – 20

    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.

  • 53000538.1 – 20

    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.

  • 53100538.1 – 20

    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.

  • 53200538.1 – 20

    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 allocation context, not a claim that every memory failure has one cause.

  • 53300538.1 – 20

    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 one and opens a second session for that role.

  • 53400539.2 – 20

    53400 reports that a configured or finite process slot is exhausted. Fixed paths cover background workers, logical-replication workers, and replication-origin state slots.

  • 54000548.1 – 20

    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 identifies the limit.

  • 54001548.1 – 20

    54001 covers a statement that exceeds a planner, parser, or execution-stack limit. Fixed paths include the 4096 grouping-set ceiling and maxstackdepth enforcement.

  • 54011548.1 – 20

    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 dimensions, or a row-producing definition.

  • 54023548.1 – 20

    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 messages.

  • 55000558.1 – 20

    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.

  • 55006558.1 – 20

    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.

  • 55P02558.1 – 20

    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.

  • 55P03558.1 – 20

    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.

  • 55P045512 – 20

    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.

    8.18.28.38.49.09.19.29.39.49.59.61011121314151617181920
  • 57000578.1 – 20

    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, severity, and recovery boundary unresolved rather than assigning it to shutdown, timeout, or cancellation.

  • 57014578.1 – 20

    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 distinguish a statement timeout, an explicit client cancel, a recovery conflict, or another administrative path.

  • 57P01578.1 – 20

    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 locally but might not have been replicated to the standby.

  • 57P02578.1 – 20

    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 memory may be corrupted.

  • 57P03578.1 – 20

    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.

  • 57P04579.0 – 20

    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 condition identity that matters here.

  • 57P055714 – 20

    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.

    8.18.28.38.49.09.19.29.39.49.59.61011121314151617181920
  • 58000589.2 – 20

    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.

  • 58030588.1 – 20

    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 be permanent.

  • 58P01588.1 – 20

    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 in recovery.

  • 58P02588.1 – 20

    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.

  • 58P035818 – 20

    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.

    8.18.28.38.49.09.19.29.39.49.59.61011121314151617181920
  • F0000F08.1 – 20

    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-parser paths.

  • F0001F08.1 – 20

    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.

  • HV000HV9.1 – 20

    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 scan; the concrete trigger therefore depends on the installed implementation.

  • HV001HV9.1 – 20

    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 cannot be allocated.

  • HV002HV9.1 – 20

    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.

  • HV004HV9.1 – 20

    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 message or SQL trigger.

  • HV005HV9.1 – 20

    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 and message remain wrapper-specific.

  • HV006HV9.1 – 20

    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.

  • HV007HV9.1 – 20

    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.

  • HV008HV9.1 – 20

    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.

  • HV009HV9.1 – 20

    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.

  • HV00AHV9.1 – 20

    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.

  • HV00BHV9.1 – 20

    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 implementation-specific.

  • HV00CHV9.1 – 20

    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.

  • HV00DHV9.1 – 20

    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.

  • HV00JHV9.1 – 20

    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 resolved HV00J group.

  • HV00KHV9.1 – 20

    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.

  • HV00LHV9.1 – 20

    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.

  • HV00MHV9.1 – 20

    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.

  • HV00NHV9.1 – 20

    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.

  • HV00PHV9.1 – 20

    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.

  • HV00QHV9.1 – 20

    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.

  • HV00RHV9.1 – 20

    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.

  • HV010HV9.1 – 20

    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.

  • HV014HV9.1 – 20

    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.

  • HV021HV9.1 – 20

    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.

  • HV024HV9.1 – 20

    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.

  • HV090HV9.1 – 20

    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.

  • HV091HV9.1 – 20

    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.

  • P0000P08.1 – 20

    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.

  • P0001P08.1 – 20

    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 an application or procedure control signal rather than a diagnosis of one server subsystem.

  • P0002P08.2 – 20

    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.

  • P0003P08.2 – 20

    P0003 is PL/pgSQL toomanyrows. Fixed paths preserve the message, optional parameter detail, hint, and the source-selected severity boundary.

  • P0004P09.5 – 20

    P0004 is PL/pgSQL assert_failure. The fixed ASSERT path reports ERROR with either the evaluated message or assertion failed.

    8.18.28.38.49.09.19.29.39.49.59.61011121314151617181920
  • XX000XX8.1 – 20

    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 corrupt.

  • XX001XX8.1 – 20

    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 mismatch.

  • XX002XX8.1 – 20

    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.