00000 — successful_completion
00000 — successful_completion
At a glance
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.
| Field | Value |
|---|---|
| SQLSTATE | 00000 |
| Condition | successful_completion |
| Status | active |
| Known present by | 7.4 |
| Locked snapshots | 9.0.23, 9.1.24, 9.2.24, 9.3.25, 9.4.26, 9.5.25, 9.6.24, 10.23, 11.22, 12.22, 13.23, 14.24, 15.19, 16.15, 17.11, 18.6, 19beta3 |
| Macros | ERRCODE_SUCCESSFUL_COMPLETION |
| Aliases | — |
Meaning
The default SQLSTATE is selected by errstart from the message level; elog.c sets ERRCODE_SUCCESSFUL_COMPLETION for levels below WARNING. This is a source-level default in the error machinery, not an application error mechanism or a promise that a normal command carries an ErrorResponse.
Messages and diagnostics
Command completion is normally represented by a successful result and command tag; it does not carry an ErrorResponse SQLSTATE. In the fixed elog path, 00000 is initialized only when no more-specific code is supplied and the message level is below WARNING. Preserve a diagnostic’s actual protocol message type and severity alongside the code: 00000 is not an ERROR default and does not turn a successful result into an ErrorResponse.
Diagnosis
Check the client result status and command tag first. If a client reports 00000 alongside a failed status or an ErrorResponse, inspect the producer and client API’s status handling rather than treating it as normal successful completion or searching for an assumed error detail.
Response
Handle a successful command result as completion. For a NoticeResponse carrying 00000, retain the notice separately from the command result; investigate client status handling only when those signals conflict. Do not retry a successful command merely because this code is present.
Versions
The locked catalogue has 00000 from 9.0.23 through 18.6 and 19 Beta 3, with known_present_by 7.4. The fixed 18.6 elog.c path shows the default assignment for levels below WARNING; it is not a runtime test of every client protocol.
Related
01000 is the warning class; 02000 is no-data, a different condition; P0002 is PL/pgSQL no_data_found.
Sources
errcodes.txt— definition, SHA-2566e8de346643ba84aa3c9c6a73360acfc7b2dfb89162c06c08ce9bf5bcd5bbcba.elog.c— fixed path, SHA-256766d30a426ba1d9597657bd46fb890da3e37e4ae53a83d1245bf082ed9433c33.- Structured evidence — fixed sources, message groups, and runtime boundary.