# 00000 — successful_completion

> PostgreSQL SQLSTATE 00000 represents successful completion and is not a normal error condition.
---

# 00000 — successful_completion

## At a glance {#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.

<!-- BEGIN SQLSTATE FACTS: generated by scripts/generate.py; do not edit -->

| 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 | `—` |

<!-- source facts: data/errcodes/00000.json -->
<!-- END SQLSTATE FACTS -->

## Meaning {#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 {#messages}

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 {#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 {#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 {#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 {#related}

[`01000`](../01000/) is the warning class; [`02000`](../02000/) is no-data, a different condition; [`P0002`](../p0002/) is PL/pgSQL `no_data_found`.

## Sources {#sources}

- [`errcodes.txt`](https://github.com/postgres/postgres/blob/724edf9bde9d356724ad384a2e196edc3c9f80f7/src/backend/utils/errcodes.txt#L79) — definition, SHA-256 `6e8de346643ba84aa3c9c6a73360acfc7b2dfb89162c06c08ce9bf5bcd5bbcba`.
- [`elog.c`](https://github.com/postgres/postgres/blob/724edf9bde9d356724ad384a2e196edc3c9f80f7/src/backend/utils/error/elog.c#L449-L457) — fixed path, SHA-256 `766d30a426ba1d9597657bd46fb890da3e37e4ae53a83d1245bf082ed9433c33`.
- [Structured evidence](../data/evidence/00000.json) — fixed sources, message groups, and runtime boundary.
