40003 — statement_completion_unknown
40003 — statement_completion_unknown
At a glance
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.
| Field | Value |
|---|---|
| SQLSTATE | 40003 |
| Condition | statement_completion_unknown |
| 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_T_R_STATEMENT_COMPLETION_UNKNOWN |
| Aliases | — |
Meaning
40003 means statement completion is unknown: after a connection or transport failure, the client cannot tell whether the server completed the statement. It is an outcome-knowledge boundary, not proof that the statement failed and not an instruction to roll back blindly.
Diagnosis
Correlate the request or idempotency key with server logs, backend activity, commit records, and durable business state. A socket exception commonly has no server SQLSTATE, and the fixed scan has no safe core SQL-only 40003 trigger. Treat a client timeout, broken connection, or ROLLBACK on a new session as separate facts rather than evidence that the original statement was undone.
Response
Reconcile before retrying: query authoritative durable state on a new healthy session, use an idempotency key only after matching the original request and business result, and ask the application whether the operation is safe to repeat. Do not claim that a generic retry or rollback resolves an unknown completion, and do not manufacture 40003 with RAISE or a local timeout.
Versions
The locked facts table records catalogue presence across the project snapshot range. The fixed source evidence is limited to the path stated below; no exact behavioral introduction or broader runtime coverage is inferred from the definition alone.
Related
Compare 40001 serialization failure for a server-confirmed retryable outcome; 40003 requires reconciliation because completion is uncertain.
Sources
src.errcodes.18.6(SHA-2566e8de346643ba84aa3c9c6a73360acfc7b2dfb89162c06c08ce9bf5bcd5bbcba)src.calls.REL_18_6fixed call scan (SHA-2569ee8a0e81d8f0825c5c1ae45583439859a26e602bdd4ce2f2a62aa278867ccbf)