{"Entry":{"collection":"sqlstate","key":"P0004","name":"P0004","aliases":[],"metadata":{"aliases":[],"case_count":1,"class_code":"P0","condition_name":"assert_failure","condition_names":["assert_failure"],"content_hash":"2ff7cb0bde14a1b25fd95ebb592126f77b7630bc0a911757dc81d7a96f021ad4","depth":"full","editorial_review":"reviewed","evidence_tier":"observed_runtime","imported_at":"2026-09-30T17:45:28.15821+08:00","introduced":null,"known_present_by":"9.5.0","macros":["ERRCODE_ASSERT_FAILURE"],"name_zh":"","present_in":["9.5","9.6","10","11","12","13","14","15","16","17","18","19"],"preview_in":["19"],"primary_macro":"ERRCODE_ASSERT_FAILURE","removed":null,"runtime_verification":"passed","severity_classes":["E"],"snippet_count":1,"source_rev":"english-manuals:7b52e2fa72c2635d8c6f026e04c4234c170292416ad23065c2234b43e0c4d270","sqlstate":"P0004","status":"active","summary_zh":"PL/pgSQL 的 ASSERT 断言条件不成立。"}},"Definition":{"Collection":"sqlstate","Key":"P0004","SourceDatabase":"center","Version":"18","SourceTable":"sqlstate","SourceKey":"P0004","SourceRevision":"english-manuals:7b52e2fa72c2635d8c6f026e04c4234c170292416ad23065c2234b43e0c4d270","Facts":{"aliases":[],"class_name":"PL/pgSQL Error","condition_name":"assert_failure","doc":{"anchor":"ERRCODES-APPENDIX","file":"errcodes-appendix.html","lang":"en","sha256":"56dacf78e618ff0fd8c533e05db597b80d7ebbad7f8e512a888217d0640aa328","slug":"18"},"lang":"en","sqlstate":"P0004"},"ManualEvidence":{"doc":{"anchor":"ERRCODES-APPENDIX","file":"errcodes-appendix.html","lang":"en","sha256":"56dacf78e618ff0fd8c533e05db597b80d7ebbad7f8e512a888217d0640aa328","slug":"18"}},"MeasuredEvidence":{}},"Text":{"Collection":"sqlstate","Key":"P0004","SourceDatabase":"center","Version":"","Locale":"en","Title":"P0004 — assert_failure","Summary":"P0004 is PL/pgSQL assert_failure. The fixed ASSERT path reports ERROR with either the evaluated message or assertion failed.","BodyHTML":"\u003ch1\u003eP0004\u003c/h1\u003e\n\u003ch2\u003eAt a glance {#at-a-glance}\u003c/h2\u003e\n\u003cp\u003eP0004 is PL/pgSQL \u003ccode\u003eassert_failure\u003c/code\u003e. The fixed ASSERT path reports ERROR with either the evaluated message or \u003ccode\u003eassertion failed\u003c/code\u003e.\u003c/p\u003e\n\u003cp\u003eThe shared \u003ccode\u003eassertion_failure_recovery\u003c/code\u003e case passed on PostgreSQL 18.6 and PostgreSQL 10.21. With \u003ccode\u003eplpgsql.check_asserts\u003c/code\u003e enabled, the false ASSERT returned \u003ccode\u003eP0004\u003c/code\u003e with \u003ccode\u003evalue must be positive\u003c/code\u003e and left the explicit transaction \u003ccode\u003eINERROR\u003c/code\u003e; \u003ccode\u003eROLLBACK\u003c/code\u003e restored \u003ccode\u003eIDLE\u003c/code\u003e, a valid input succeeded, and the disabled-assert control returned zero.\u003c/p\u003e\n\u003cpre\u003e\u003ccode\u003eCREATE OR REPLACE FUNCTION p0004_assert(value integer) RETURNS integer LANGUAGE plpgsql AS $$ BEGIN ASSERT value \u0026gt; 0, \u0026#39;value must be positive\u0026#39;; RETURN value; END $$;\nSET plpgsql.check_asserts = on;\nSHOW plpgsql.check_asserts;\nBEGIN;\nSELECT p0004_assert(0);\nROLLBACK;\nSELECT p0004_assert(1);\nSET plpgsql.check_asserts = off;\nSHOW plpgsql.check_asserts;\nSELECT p0004_assert(0);\nSET plpgsql.check_asserts = on;\nSHOW plpgsql.check_asserts;\nSELECT p0004_assert(1);\n\u003c/code\u003e\u003c/pre\u003e\n\u003ch2\u003eMeaning {#meaning}\u003c/h2\u003e\n\u003cp\u003eAn ASSERT is an executable invariant check inside PL/pgSQL. PostgreSQL evaluates its Boolean condition; a false \u003cstrong\u003eor NULL\u003c/strong\u003e result takes the assertion-failure path. The fixed executor then reports \u003ccode\u003eERROR\u003c/code\u003e with SQLSTATE \u003ccode\u003eP0004\u003c/code\u003e: it evaluates the message expression only on that path, uses a non-NULL result as the primary text, and uses \u003ccode\u003eassertion failed\u003c/code\u003e for a NULL or omitted message. With checks disabled, it skips both the condition and message expression.\u003c/p\u003e\n\u003cp\u003e\u003ccode\u003eplpgsql.check_asserts\u003c/code\u003e is a session setting that controls whether ASSERT statements are checked. With it enabled, a failed assertion is a real ERROR and an explicit transaction enters \u003ccode\u003eINERROR\u003c/code\u003e. With it disabled, ASSERT statements are skipped; the same false input does not prove the invariant and should not be used as a production validation substitute.\u003c/p\u003e\n\u003cp\u003eThe selected runtime exercises a false condition with a non-NULL message and a false condition with checks disabled. The \u003ccode\u003eNULL\u003c/code\u003e condition and the no-message fallback are source-confirmed semantics, not additional natural observations in this batch.\u003c/p\u003e\n\u003ch2\u003eDiagnosis {#diagnosis}\u003c/h2\u003e\n\u003cp\u003eStart with the ErrorResponse fields and the server log entry together. In the fixed 18.6 path, \u003ccode\u003emessage_primary\u003c/code\u003e is either the evaluated message or \u003ccode\u003eassertion failed\u003c/code\u003e; the runtime case also recorded \u003ccode\u003eERROR\u003c/code\u003e, \u003ccode\u003eP0004\u003c/code\u003e, \u003ccode\u003eexec_stmt_assert\u003c/code\u003e, and context identifying the PL/pgSQL function and \u003ccode\u003eline 1 at ASSERT\u003c/code\u003e. Check \u003ccode\u003eSHOW plpgsql.check_asserts\u003c/code\u003e on the affected session, because a setting change in another connection does not change this one.\u003c/p\u003e\n\u003cp\u003eIf the primary is \u003ccode\u003eassertion failed\u003c/code\u003e, check whether the ASSERT had no message or its message expression evaluated to NULL. If there is no P0004 at all, inspect \u003ccode\u003eSHOW plpgsql.check_asserts\u003c/code\u003e first: a disabled setting skips the check before evaluating its condition. Keep the function source and the session setting together when comparing two calls; a pooled connection can have a different setting from the one that created the function.\u003c/p\u003e\n\u003cp\u003eSeparate a broken program invariant from expected business input. An assertion such as \u003ccode\u003evalue \u0026gt; 0\u003c/code\u003e is useful for an assumption that should always hold after validation; an expected negative user value belongs in ordinary validation, a constraint, or an explicit application error with a deliberate SQLSTATE. If the error occurred inside an explicit transaction, inspect the transaction state before issuing another command: the observed case was \u003ccode\u003eINERROR\u003c/code\u003e until \u003ccode\u003eROLLBACK\u003c/code\u003e, not a connection failure.\u003c/p\u003e\n\u003ch2\u003eResponse {#response}\u003c/h2\u003e\n\u003cp\u003eFor an explicit transaction, issue \u003ccode\u003eROLLBACK\u003c/code\u003e before unrelated work, then reproduce with the corrected invariant or input. The shared case verified \u003ccode\u003eROLLBACK → IDLE\u003c/code\u003e, a valid call returning \u003ccode\u003e1\u003c/code\u003e, and the same assertion remaining silent when \u003ccode\u003eplpgsql.check_asserts\u003c/code\u003e was set to \u003ccode\u003eoff\u003c/code\u003e.\u003c/p\u003e\n\u003cp\u003eUse \u003ccode\u003eWHEN ASSERT_FAILURE\u003c/code\u003e when a PL/pgSQL block deliberately wants to handle this named condition. \u003ccode\u003eWHEN OTHERS\u003c/code\u003e does not catch \u003ccode\u003eASSERT_FAILURE\u003c/code\u003e, so a broad handler cannot be used as a hidden assertion switch. An exception block can recover through its documented subtransaction boundary, but swallowing the failure without checking the invariant leaves the program assumption unverified. Keep assertions enabled while diagnosing; disabling them is a diagnostic control, not a repair.\u003c/p\u003e\n\u003ch2\u003eVersions {#versions}\u003c/h2\u003e\n\u003cp\u003eThe locked catalogue records P0004 from 9.5.0 through the listed formal snapshots and 19beta3. The fixed executor source is PostgreSQL 18.6 \u003ca href=\"https://github.com/postgres/postgres/blob/724edf9bde9d356724ad384a2e196edc3c9f80f7/src/pl/plpgsql/src/pl_exec.c#L3965-L3968\" rel=\"nofollow\"\u003e\u003ccode\u003epl_exec.c#L3965-L3968\u003c/code\u003e\u003c/a\u003e. The official \u003ca href=\"/docs/18/plpgsql-errors-and-messages.html\" rel=\"nofollow\"\u003ePL/pgSQL error and message documentation\u003c/a\u003e covers ASSERT and named conditions; the \u003ca href=\"/docs/18/plpgsql-control-structures.html#PLPGSQL-ERROR-TRAPPING\" rel=\"nofollow\"\u003econtrol-structures error-trapping documentation\u003c/a\u003e defines the \u003ccode\u003eEXCEPTION\u003c/code\u003e subtransaction and handler matching boundary. The latest/PG10 runtime case confirms the described P0004 and transaction behavior for the shared function.\u003c/p\u003e\n\u003ch2\u003eRelated {#related}\u003c/h2\u003e\n\u003cp\u003e\u003ca href=\"/wiki/sqlstate/P0002/\" rel=\"nofollow\"\u003e\u003ccode\u003eP0002\u003c/code\u003e\u003c/a\u003e for PL/pgSQL no-data handling, \u003ca href=\"/wiki/sqlstate/P0003/\" rel=\"nofollow\"\u003e\u003ccode\u003eP0003\u003c/code\u003e\u003c/a\u003e for strict multi-row handling, and \u003ca href=\"/wiki/sqlstate/P0000/\" rel=\"nofollow\"\u003e\u003ccode\u003eP0000\u003c/code\u003e\u003c/a\u003e for the PL/pgSQL error category. Use the actual SQLSTATE from the response rather than treating every PL/pgSQL failure as P0004.\u003c/p\u003e\n\u003ch2\u003eSources {#sources}\u003c/h2\u003e\n\u003cp\u003eThe fixed implementation is \u003ca href=\"https://github.com/postgres/postgres/blob/724edf9bde9d356724ad384a2e196edc3c9f80f7/src/pl/plpgsql/src/pl_exec.c#L3965-L3968\" rel=\"nofollow\"\u003e\u003ccode\u003epl_exec.c#L3965-L3968\u003c/code\u003e\u003c/a\u003e. The official \u003ca href=\"/docs/18/plpgsql-errors-and-messages.html\" rel=\"nofollow\"\u003ePL/pgSQL error and message reference\u003c/a\u003e documents ASSERT semantics, while the \u003ca href=\"/docs/18/plpgsql-control-structures.html#PLPGSQL-ERROR-TRAPPING\" rel=\"nofollow\"\u003econtrol-structures error-trapping reference\u003c/a\u003e documents the \u003ccode\u003eWHEN OTHERS\u003c/code\u003e exclusion and subtransaction boundary. The structured \u003ca href=\"#sources\" rel=\"nofollow\"\u003eevidence record\u003c/a\u003e pins the source SHA, runtime summaries, raw results, and shared snippet registry.\u003c/p\u003e\n","SourceRevision":"english-manuals:7b52e2fa72c2635d8c6f026e04c4234c170292416ad23065c2234b43e0c4d270","ContentHash":"f59fb6c62d127809a83ab9a709b16e96240a9d3c40f6c58603e562f0c729ff01","Payload":{"body_md":"# P0004\n\n## At a glance {#at-a-glance}\n\nP0004 is PL/pgSQL `assert_failure`. The fixed ASSERT path reports ERROR with either the evaluated message or `assertion failed`.\n\n\nThe shared `assertion_failure_recovery` case passed on PostgreSQL 18.6 and PostgreSQL 10.21. With `plpgsql.check_asserts` enabled, the false ASSERT returned `P0004` with `value must be positive` and left the explicit transaction `INERROR`; `ROLLBACK` restored `IDLE`, a valid input succeeded, and the disabled-assert control returned zero.\n\n```sql\nCREATE OR REPLACE FUNCTION p0004_assert(value integer) RETURNS integer LANGUAGE plpgsql AS $$ BEGIN ASSERT value \u003e 0, 'value must be positive'; RETURN value; END $$;\nSET plpgsql.check_asserts = on;\nSHOW plpgsql.check_asserts;\nBEGIN;\nSELECT p0004_assert(0);\nROLLBACK;\nSELECT p0004_assert(1);\nSET plpgsql.check_asserts = off;\nSHOW plpgsql.check_asserts;\nSELECT p0004_assert(0);\nSET plpgsql.check_asserts = on;\nSHOW plpgsql.check_asserts;\nSELECT p0004_assert(1);\n```\n\n## Meaning {#meaning}\n\nAn ASSERT is an executable invariant check inside PL/pgSQL. PostgreSQL evaluates its Boolean condition; a false **or NULL** result takes the assertion-failure path. The fixed executor then reports `ERROR` with SQLSTATE `P0004`: it evaluates the message expression only on that path, uses a non-NULL result as the primary text, and uses `assertion failed` for a NULL or omitted message. With checks disabled, it skips both the condition and message expression.\n\n`plpgsql.check_asserts` is a session setting that controls whether ASSERT statements are checked. With it enabled, a failed assertion is a real ERROR and an explicit transaction enters `INERROR`. With it disabled, ASSERT statements are skipped; the same false input does not prove the invariant and should not be used as a production validation substitute.\n\nThe selected runtime exercises a false condition with a non-NULL message and a false condition with checks disabled. The `NULL` condition and the no-message fallback are source-confirmed semantics, not additional natural observations in this batch.\n\n## Diagnosis {#diagnosis}\n\nStart with the ErrorResponse fields and the server log entry together. In the fixed 18.6 path, `message_primary` is either the evaluated message or `assertion failed`; the runtime case also recorded `ERROR`, `P0004`, `exec_stmt_assert`, and context identifying the PL/pgSQL function and `line 1 at ASSERT`. Check `SHOW plpgsql.check_asserts` on the affected session, because a setting change in another connection does not change this one.\n\nIf the primary is `assertion failed`, check whether the ASSERT had no message or its message expression evaluated to NULL. If there is no P0004 at all, inspect `SHOW plpgsql.check_asserts` first: a disabled setting skips the check before evaluating its condition. Keep the function source and the session setting together when comparing two calls; a pooled connection can have a different setting from the one that created the function.\n\nSeparate a broken program invariant from expected business input. An assertion such as `value \u003e 0` is useful for an assumption that should always hold after validation; an expected negative user value belongs in ordinary validation, a constraint, or an explicit application error with a deliberate SQLSTATE. If the error occurred inside an explicit transaction, inspect the transaction state before issuing another command: the observed case was `INERROR` until `ROLLBACK`, not a connection failure.\n\n## Response {#response}\n\nFor an explicit transaction, issue `ROLLBACK` before unrelated work, then reproduce with the corrected invariant or input. The shared case verified `ROLLBACK → IDLE`, a valid call returning `1`, and the same assertion remaining silent when `plpgsql.check_asserts` was set to `off`.\n\nUse `WHEN ASSERT_FAILURE` when a PL/pgSQL block deliberately wants to handle this named condition. `WHEN OTHERS` does not catch `ASSERT_FAILURE`, so a broad handler cannot be used as a hidden assertion switch. An exception block can recover through its documented subtransaction boundary, but swallowing the failure without checking the invariant leaves the program assumption unverified. Keep assertions enabled while diagnosing; disabling them is a diagnostic control, not a repair.\n\n## Versions {#versions}\n\nThe locked catalogue records P0004 from 9.5.0 through the listed formal snapshots and 19beta3. The fixed executor source is PostgreSQL 18.6 [`pl_exec.c#L3965-L3968`](https://github.com/postgres/postgres/blob/724edf9bde9d356724ad384a2e196edc3c9f80f7/src/pl/plpgsql/src/pl_exec.c#L3965-L3968). The official [PL/pgSQL error and message documentation](/docs/18/plpgsql-errors-and-messages.html) covers ASSERT and named conditions; the [control-structures error-trapping documentation](/docs/18/plpgsql-control-structures.html#PLPGSQL-ERROR-TRAPPING) defines the `EXCEPTION` subtransaction and handler matching boundary. The latest/PG10 runtime case confirms the described P0004 and transaction behavior for the shared function.\n\n## Related {#related}\n\n[`P0002`](/wiki/sqlstate/P0002/) for PL/pgSQL no-data handling, [`P0003`](/wiki/sqlstate/P0003/) for strict multi-row handling, and [`P0000`](/wiki/sqlstate/P0000/) for the PL/pgSQL error category. Use the actual SQLSTATE from the response rather than treating every PL/pgSQL failure as P0004.\n\n## Sources {#sources}\n\nThe fixed implementation is [`pl_exec.c#L3965-L3968`](https://github.com/postgres/postgres/blob/724edf9bde9d356724ad384a2e196edc3c9f80f7/src/pl/plpgsql/src/pl_exec.c#L3965-L3968). The official [PL/pgSQL error and message reference](/docs/18/plpgsql-errors-and-messages.html) documents ASSERT semantics, while the [control-structures error-trapping reference](/docs/18/plpgsql-control-structures.html#PLPGSQL-ERROR-TRAPPING) documents the `WHEN OTHERS` exclusion and subtransaction boundary. The structured [evidence record](#sources) pins the source SHA, runtime summaries, raw results, and shared snippet registry.\n","description":"Source-backed reference for PostgreSQL SQLSTATE P0004.","is_stale":false,"name":"","sections":[{"anchor":"","heading":"","html":"\u0026lt;h1\u0026gt;P0004\u0026lt;/h1\u0026gt;"},{"anchor":"at-a-glance","heading":"At a glance","html":"\u003cp\u003eP0004 is PL/pgSQL \u003ccode\u003eassert_failure\u003c/code\u003e. The fixed ASSERT path reports ERROR with either the evaluated message or \u003ccode\u003eassertion failed\u003c/code\u003e.\u003c/p\u003e\n\u003cp\u003eThe shared \u003ccode\u003eassertion_failure_recovery\u003c/code\u003e case passed on PostgreSQL 18.6 and PostgreSQL 10.21. With \u003ccode\u003eplpgsql.check_asserts\u003c/code\u003e enabled, the false ASSERT returned \u003ccode\u003eP0004\u003c/code\u003e with \u003ccode\u003evalue must be positive\u003c/code\u003e and left the explicit transaction \u003ccode\u003eINERROR\u003c/code\u003e; \u003ccode\u003eROLLBACK\u003c/code\u003e restored \u003ccode\u003eIDLE\u003c/code\u003e, a valid input succeeded, and the disabled-assert control returned zero.\u003c/p\u003e\n\u003cpre\u003e\u003ccode class=\"language-sql\"\u003eCREATE OR REPLACE FUNCTION p0004_assert(value integer) RETURNS integer LANGUAGE plpgsql AS $$ BEGIN ASSERT value \u0026gt; 0, 'value must be positive'; RETURN value; END $$;\nSET plpgsql.check_asserts = on;\nSHOW plpgsql.check_asserts;\nBEGIN;\nSELECT p0004_assert(0);\nROLLBACK;\nSELECT p0004_assert(1);\nSET plpgsql.check_asserts = off;\nSHOW plpgsql.check_asserts;\nSELECT p0004_assert(0);\nSET plpgsql.check_asserts = on;\nSHOW plpgsql.check_asserts;\nSELECT p0004_assert(1);\n\u003c/code\u003e\u003c/pre\u003e"},{"anchor":"meaning","heading":"Meaning","html":"\u003cp\u003eAn ASSERT is an executable invariant check inside PL/pgSQL. PostgreSQL evaluates its Boolean condition; a false \u003cstrong\u003eor NULL\u003c/strong\u003e result takes the assertion-failure path. The fixed executor then reports \u003ccode\u003eERROR\u003c/code\u003e with SQLSTATE \u003ccode\u003eP0004\u003c/code\u003e: it evaluates the message expression only on that path, uses a non-NULL result as the primary text, and uses \u003ccode\u003eassertion failed\u003c/code\u003e for a NULL or omitted message. With checks disabled, it skips both the condition and message expression.\u003c/p\u003e\n\u003cp\u003e\u003ccode\u003eplpgsql.check_asserts\u003c/code\u003e is a session setting that controls whether ASSERT statements are checked. With it enabled, a failed assertion is a real ERROR and an explicit transaction enters \u003ccode\u003eINERROR\u003c/code\u003e. With it disabled, ASSERT statements are skipped; the same false input does not prove the invariant and should not be used as a production validation substitute.\u003c/p\u003e\n\u003cp\u003eThe selected runtime exercises a false condition with a non-NULL message and a false condition with checks disabled. The \u003ccode\u003eNULL\u003c/code\u003e condition and the no-message fallback are source-confirmed semantics, not additional natural observations in this batch.\u003c/p\u003e"},{"anchor":"diagnosis","heading":"Diagnosis","html":"\u003cp\u003eStart with the ErrorResponse fields and the server log entry together. In the fixed 18.6 path, \u003ccode\u003emessage_primary\u003c/code\u003e is either the evaluated message or \u003ccode\u003eassertion failed\u003c/code\u003e; the runtime case also recorded \u003ccode\u003eERROR\u003c/code\u003e, \u003ccode\u003eP0004\u003c/code\u003e, \u003ccode\u003eexec_stmt_assert\u003c/code\u003e, and context identifying the PL/pgSQL function and \u003ccode\u003eline 1 at ASSERT\u003c/code\u003e. Check \u003ccode\u003eSHOW plpgsql.check_asserts\u003c/code\u003e on the affected session, because a setting change in another connection does not change this one.\u003c/p\u003e\n\u003cp\u003eIf the primary is \u003ccode\u003eassertion failed\u003c/code\u003e, check whether the ASSERT had no message or its message expression evaluated to NULL. If there is no P0004 at all, inspect \u003ccode\u003eSHOW plpgsql.check_asserts\u003c/code\u003e first: a disabled setting skips the check before evaluating its condition. Keep the function source and the session setting together when comparing two calls; a pooled connection can have a different setting from the one that created the function.\u003c/p\u003e\n\u003cp\u003eSeparate a broken program invariant from expected business input. An assertion such as \u003ccode\u003evalue \u0026gt; 0\u003c/code\u003e is useful for an assumption that should always hold after validation; an expected negative user value belongs in ordinary validation, a constraint, or an explicit application error with a deliberate SQLSTATE. If the error occurred inside an explicit transaction, inspect the transaction state before issuing another command: the observed case was \u003ccode\u003eINERROR\u003c/code\u003e until \u003ccode\u003eROLLBACK\u003c/code\u003e, not a connection failure.\u003c/p\u003e"},{"anchor":"response","heading":"Response","html":"\u003cp\u003eFor an explicit transaction, issue \u003ccode\u003eROLLBACK\u003c/code\u003e before unrelated work, then reproduce with the corrected invariant or input. The shared case verified \u003ccode\u003eROLLBACK → IDLE\u003c/code\u003e, a valid call returning \u003ccode\u003e1\u003c/code\u003e, and the same assertion remaining silent when \u003ccode\u003eplpgsql.check_asserts\u003c/code\u003e was set to \u003ccode\u003eoff\u003c/code\u003e.\u003c/p\u003e\n\u003cp\u003eUse \u003ccode\u003eWHEN ASSERT_FAILURE\u003c/code\u003e when a PL/pgSQL block deliberately wants to handle this named condition. \u003ccode\u003eWHEN OTHERS\u003c/code\u003e does not catch \u003ccode\u003eASSERT_FAILURE\u003c/code\u003e, so a broad handler cannot be used as a hidden assertion switch. An exception block can recover through its documented subtransaction boundary, but swallowing the failure without checking the invariant leaves the program assumption unverified. Keep assertions enabled while diagnosing; disabling them is a diagnostic control, not a repair.\u003c/p\u003e"},{"anchor":"versions","heading":"Versions","html":"\u003cp\u003eThe locked catalogue records P0004 from 9.5.0 through the listed formal snapshots and 19beta3. The fixed executor source is PostgreSQL 18.6 \u003ca href=\"https://github.com/postgres/postgres/blob/724edf9bde9d356724ad384a2e196edc3c9f80f7/src/pl/plpgsql/src/pl_exec.c#L3965-L3968\"\u003e\u003ccode\u003epl_exec.c#L3965-L3968\u003c/code\u003e\u003c/a\u003e. The official \u003ca href=\"/docs/18/plpgsql-errors-and-messages.html\"\u003ePL/pgSQL error and message documentation\u003c/a\u003e covers ASSERT and named conditions; the \u003ca href=\"/docs/18/plpgsql-control-structures.html#PLPGSQL-ERROR-TRAPPING\"\u003econtrol-structures error-trapping documentation\u003c/a\u003e defines the \u003ccode\u003eEXCEPTION\u003c/code\u003e subtransaction and handler matching boundary. The latest/PG10 runtime case confirms the described P0004 and transaction behavior for the shared function.\u003c/p\u003e"},{"anchor":"related","heading":"Related","html":"\u003cp\u003e\u003ca href=\"/wiki/sqlstate/P0002/\"\u003e\u003ccode\u003eP0002\u003c/code\u003e\u003c/a\u003e for PL/pgSQL no-data handling, \u003ca href=\"/wiki/sqlstate/P0003/\"\u003e\u003ccode\u003eP0003\u003c/code\u003e\u003c/a\u003e for strict multi-row handling, and \u003ca href=\"/wiki/sqlstate/P0000/\"\u003e\u003ccode\u003eP0000\u003c/code\u003e\u003c/a\u003e for the PL/pgSQL error category. Use the actual SQLSTATE from the response rather than treating every PL/pgSQL failure as P0004.\u003c/p\u003e"},{"anchor":"sources","heading":"Sources","html":"\u003cp\u003eThe fixed implementation is \u003ca href=\"https://github.com/postgres/postgres/blob/724edf9bde9d356724ad384a2e196edc3c9f80f7/src/pl/plpgsql/src/pl_exec.c#L3965-L3968\"\u003e\u003ccode\u003epl_exec.c#L3965-L3968\u003c/code\u003e\u003c/a\u003e. The official \u003ca href=\"/docs/18/plpgsql-errors-and-messages.html\"\u003ePL/pgSQL error and message reference\u003c/a\u003e documents ASSERT semantics, while the \u003ca href=\"/docs/18/plpgsql-control-structures.html#PLPGSQL-ERROR-TRAPPING\"\u003econtrol-structures error-trapping reference\u003c/a\u003e documents the \u003ccode\u003eWHEN OTHERS\u003c/code\u003e exclusion and subtransaction boundary. The structured \u003ca href=\"#sources\"\u003eevidence record\u003c/a\u003e pins the source SHA, runtime summaries, raw results, and shared snippet registry.\u003c/p\u003e"}],"summary":"P0004 is PL/pgSQL assert_failure. The fixed ASSERT path reports ERROR with either the evaluated message or assertion failed.","title":"P0004 — assert_failure","translation_source_rev":"df71634a4c96ebff6850ccab7369594b9bea62e34afd45af1b343406748622e8"}},"RequestedLocale":"en","Fallback":false,"Versions":["10","11","12","13","14","15","16","17","18","19","20","9.5","9.6"],"Locales":["en","zh-Hans"],"Signatures":null,"Spellings":null,"SQLState":{"aliases":[],"catalogue_notes":{"earliest_observed":"9.5.0","formal_scope":"9.0.0..18.6","latest_observed":"18.6","matrix_scope":["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"],"pre9_scope":{"formal_tag_count":191,"maximum_release":"8.4.22","minimum_release":"7.0.0","source_definition_count":153,"source_doc_count":153,"source_file_count":306,"source_scope":"7.4..8.4 definition files; 7.0..7.3 candidate-path source gap probes","source_tag_count":153},"pre9_status":"not_observed","preview_scope":["19beta3"]},"class":"P0","class_name":"PL/pgSQL Error","condition_name":"assert_failure","condition_names":["assert_failure"],"definition_changes":[],"english_manuals":{"10":{"aliases":[],"class_name":"PL/pgSQL Error","condition_name":"assert_failure","doc":{"anchor":"ERRCODES-APPENDIX","file":"errcodes-appendix.html","lang":"en","sha256":"9607b57e9f639b61785677ba4d226f5889fe1d19c8bf55a3337691899a9073cd","slug":"10"},"lang":"en","sqlstate":"P0004"},"11":{"aliases":[],"class_name":"PL/pgSQL Error","condition_name":"assert_failure","doc":{"anchor":"ERRCODES-APPENDIX","file":"errcodes-appendix.html","lang":"en","sha256":"3a024e38263ad77de228eed7930b842b42dc1d5cab9ca3727be8eed872ec9539","slug":"11"},"lang":"en","sqlstate":"P0004"},"12":{"aliases":[],"class_name":"PL/pgSQL Error","condition_name":"assert_failure","doc":{"anchor":"ERRCODES-APPENDIX","file":"errcodes-appendix.html","lang":"en","sha256":"1444bd6a138537cd75be88a220ee9472ac528f0cfc58758e49636d85455efe98","slug":"12"},"lang":"en","sqlstate":"P0004"},"13":{"aliases":[],"class_name":"PL/pgSQL Error","condition_name":"assert_failure","doc":{"anchor":"ERRCODES-APPENDIX","file":"errcodes-appendix.html","lang":"en","sha256":"4a3ef8af218e5736dfde8660ba609e84233b6b3bac7e0210ff8724cf1b27b2db","slug":"13"},"lang":"en","sqlstate":"P0004"},"14":{"aliases":[],"class_name":"PL/pgSQL Error","condition_name":"assert_failure","doc":{"anchor":"ERRCODES-APPENDIX","file":"errcodes-appendix.html","lang":"en","sha256":"1c12e83304e0f4ff64c9d98ca5e3007df6756932ed19867a4fa0e0650f6c5751","slug":"14"},"lang":"en","sqlstate":"P0004"},"15":{"aliases":[],"class_name":"PL/pgSQL Error","condition_name":"assert_failure","doc":{"anchor":"ERRCODES-APPENDIX","file":"errcodes-appendix.html","lang":"en","sha256":"2161f58f6e87f6535b3b1f3d4661427bb6765f4f6b074fcc16fac97594b50599","slug":"15"},"lang":"en","sqlstate":"P0004"},"16":{"aliases":[],"class_name":"PL/pgSQL Error","condition_name":"assert_failure","doc":{"anchor":"ERRCODES-APPENDIX","file":"errcodes-appendix.html","lang":"en","sha256":"928e705933d7c3d018ae3fba9d800b34e6325746d157339dce878473c519d100","slug":"16"},"lang":"en","sqlstate":"P0004"},"17":{"aliases":[],"class_name":"PL/pgSQL Error","condition_name":"assert_failure","doc":{"anchor":"ERRCODES-APPENDIX","file":"errcodes-appendix.html","lang":"en","sha256":"868135520af87351e3ea1ba42656111cbd2d157d98e1fef05ea158ac5729d8b1","slug":"17"},"lang":"en","sqlstate":"P0004"},"18":{"aliases":[],"class_name":"PL/pgSQL Error","condition_name":"assert_failure","doc":{"anchor":"ERRCODES-APPENDIX","file":"errcodes-appendix.html","lang":"en","sha256":"56dacf78e618ff0fd8c533e05db597b80d7ebbad7f8e512a888217d0640aa328","slug":"18"},"lang":"en","sqlstate":"P0004"},"19":{"aliases":[],"class_name":"PL/pgSQL Error","condition_name":"assert_failure","doc":{"anchor":"ERRCODES-APPENDIX","file":"errcodes-appendix.html","lang":"en","sha256":"63fb8d1aa9f494eeab9d0f8542a2b673f7746ee41ae2689d19403cb3cc425a5c","slug":"19"},"lang":"en","sqlstate":"P0004"},"20":{"aliases":[],"class_name":"PL/pgSQL Error","condition_name":"assert_failure","doc":{"anchor":"ERRCODES-APPENDIX","file":"errcodes-appendix.html","lang":"en","sha256":"0d3f602127cd137cf343b32d5fa78f175eeb6cdcb6353b1f6f998ede6cb7b911","slug":"devel"},"lang":"en","sqlstate":"P0004"},"9.5":{"aliases":[],"class_name":"PL/pgSQL Error","condition_name":"assert_failure","doc":{"anchor":"ERRCODES-APPENDIX","file":"errcodes-appendix.html","lang":"en","sha256":"d40bc67cb331f1e4ccc0821ff57832c6c230edb0dce3ba4249defd21ae7ea29d","slug":"9.5"},"lang":"en","sqlstate":"P0004"},"9.6":{"aliases":[],"class_name":"PL/pgSQL Error","condition_name":"assert_failure","doc":{"anchor":"ERRCODES-APPENDIX","file":"errcodes-appendix.html","lang":"en","sha256":"2ab55e487571c8998ec39b3d1bbae29ac6fc5c310875bee422d9a7b8b3fde5b3","slug":"9.6"},"lang":"en","sqlstate":"P0004"}},"history_boundary":{"earliest_observed":"9.5.0","formal_tag_count":351,"gaps":[{"after":"18.6","before":"18.4","reason":"Non-adjacent release tags or a source gap; no removal is inferred."}],"latest_observed":"18.6","pre_range":{"first_observed":null,"known_lower_bound":null,"last_observed":null,"notes":"No occurrence was observed in the locked 7.4..8.4 definition files. Source gaps for 7.0..7.3 prevent a claim that the code was absent before 7.4.","scanned_formal_release_count":153,"scanned_source_scope":"7.4..8.4 definition files; 7.0..7.3 candidate-path source gap probes","source_gap_majors":["7.0","7.1","7.2","7.3"],"status":"partially_scanned"},"preview_snapshots":["19beta3"],"scanned_from":"9.0.0","scanned_to":"18.6"},"introduced":null,"known_present_by":"9.5.0","macros":["ERRCODE_ASSERT_FAILURE"],"manual_presence":["9.5","9.6","10","11","12","13","14","15","16","17","18","19","20"],"pre9_first_observed":null,"pre9_introduction_boundary":null,"pre9_last_observed":null,"pre9_presence_intervals":[],"pre9_status":"not_observed","presence_intervals":[{"end":"9.5.25","end_major":"9.5","end_tag":"REL9_5_25","evidence_count":26,"position":0,"start":"9.5.0","start_major":"9.5","start_tag":"REL9_5_0"},{"end":"9.6.24","end_major":"9.6","end_tag":"REL9_6_24","evidence_count":25,"position":1,"start":"9.6.0","start_major":"9.6","start_tag":"REL9_6_0"},{"end":"10.23","end_major":"10","end_tag":"REL_10_23","evidence_count":24,"position":2,"start":"10.0","start_major":"10","start_tag":"REL_10_0"},{"end":"11.22","end_major":"11","end_tag":"REL_11_22","evidence_count":23,"position":3,"start":"11.0","start_major":"11","start_tag":"REL_11_0"},{"end":"12.22","end_major":"12","end_tag":"REL_12_22","evidence_count":23,"position":4,"start":"12.0","start_major":"12","start_tag":"REL_12_0"},{"end":"13.23","end_major":"13","end_tag":"REL_13_23","evidence_count":24,"position":5,"start":"13.0","start_major":"13","start_tag":"REL_13_0"},{"end":"14.24","end_major":"14","end_tag":"REL_14_24","evidence_count":25,"position":6,"start":"14.0","start_major":"14","start_tag":"REL_14_0"},{"end":"15.19","end_major":"15","end_tag":"REL_15_19","evidence_count":20,"position":7,"start":"15.0","start_major":"15","start_tag":"REL_15_0"},{"end":"16.15","end_major":"16","end_tag":"REL_16_15","evidence_count":16,"position":8,"start":"16.0","start_major":"16","start_tag":"REL_16_0"},{"end":"17.11","end_major":"17","end_tag":"REL_17_11","evidence_count":12,"position":9,"start":"17.0","start_major":"17","start_tag":"REL_17_0"},{"end":"18.4","end_major":"18","end_tag":"REL_18_4","evidence_count":5,"position":10,"start":"18.0","start_major":"18","start_tag":"REL_18_0"},{"end":"18.6","end_major":"18","end_tag":"REL_18_6","evidence_count":1,"position":11,"start":"18.6","start_major":"18","start_tag":"REL_18_6"}],"present_in_snapshots":["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"],"preview_in_snapshots":["19beta3"],"primary_macro":"ERRCODE_ASSERT_FAILURE","removed":null,"schema_version":2,"severity_classes":["E"],"sources":[{"blob_id":"sha256:37f728a7e034ef0b05b060a4b82c7dd95c900e4a5501c80bfefd8d679889253b","channel":"formal","code_count":236,"commit":"cdd4ed5449bf317cc71b45a8deee0173822e7592","id":"postgresql:REL9_5_0:src/backend/utils/errcodes.txt","major":"9.5","parsed_path":"raw/definitions/REL9_5_0.parsed.json","path":"src/backend/utils/errcodes.txt","raw_path":"raw/definitions/REL9_5_0.txt","raw_url":"https://raw.githubusercontent.com/postgres/postgres/cdd4ed5449bf317cc71b45a8deee0173822e7592/src/backend/utils/errcodes.txt","record_count":242,"release":"9.5.0","release_date":null,"repository":"https://github.com/postgres/postgres.git","sha256":"37f728a7e034ef0b05b060a4b82c7dd95c900e4a5501c80bfefd8d679889253b","size":30798,"source_format":"errcodes.txt","source_role":"primary_definition","tag":"REL9_5_0","url":"https://github.com/postgres/postgres/blob/cdd4ed5449bf317cc71b45a8deee0173822e7592/src/backend/utils/errcodes.txt","version":"9.5.0"},{"blob_id":"sha256:bf4d94d84c7cfe695cb80e8f009872444574719a80a72e347eb66ef3686b86ef","channel":"formal","code_count":238,"commit":"a721a1ba9cf6c86cb52f1bf325d5a27b64e870d6","id":"postgresql:REL9_6_0:src/backend/utils/errcodes.txt","major":"9.6","parsed_path":"raw/definitions/REL9_6_0.parsed.json","path":"src/backend/utils/errcodes.txt","raw_path":"raw/definitions/REL9_6_0.txt","raw_url":"https://raw.githubusercontent.com/postgres/postgres/a721a1ba9cf6c86cb52f1bf325d5a27b64e870d6/src/backend/utils/errcodes.txt","record_count":244,"release":"9.6.0","release_date":null,"repository":"https://github.com/postgres/postgres.git","sha256":"bf4d94d84c7cfe695cb80e8f009872444574719a80a72e347eb66ef3686b86ef","size":31135,"source_format":"errcodes.txt","source_role":"primary_definition","tag":"REL9_6_0","url":"https://github.com/postgres/postgres/blob/a721a1ba9cf6c86cb52f1bf325d5a27b64e870d6/src/backend/utils/errcodes.txt","version":"9.6.0"},{"blob_id":"sha256:e5d829b24fe63aa69429fa1deb9675051fc8ffd4a8a4651861907a8f12ccb144","channel":"formal","code_count":240,"commit":"5df0e99bea1c3e5fbffa7fbd0982da88ea149bb6","id":"postgresql:REL_10_0:src/backend/utils/errcodes.txt","major":"10","parsed_path":"raw/definitions/REL_10_0.parsed.json","path":"src/backend/utils/errcodes.txt","raw_path":"raw/definitions/REL_10_0.txt","raw_url":"https://raw.githubusercontent.com/postgres/postgres/5df0e99bea1c3e5fbffa7fbd0982da88ea149bb6/src/backend/utils/errcodes.txt","record_count":246,"release":"10.0","release_date":null,"repository":"https://github.com/postgres/postgres.git","sha256":"e5d829b24fe63aa69429fa1deb9675051fc8ffd4a8a4651861907a8f12ccb144","size":31340,"source_format":"errcodes.txt","source_role":"primary_definition","tag":"REL_10_0","url":"https://github.com/postgres/postgres/blob/5df0e99bea1c3e5fbffa7fbd0982da88ea149bb6/src/backend/utils/errcodes.txt","version":"10.0"},{"blob_id":"sha256:8518be6de92ae135765e295c631c5f525120ca2b132453404b620f9aa595cab4","channel":"formal","code_count":241,"commit":"19f20081df059fef87e14c8e953669bd173dd7f1","id":"postgresql:REL_11_0:src/backend/utils/errcodes.txt","major":"11","parsed_path":"raw/definitions/REL_11_0.parsed.json","path":"src/backend/utils/errcodes.txt","raw_path":"raw/definitions/REL_11_0.txt","raw_url":"https://raw.githubusercontent.com/postgres/postgres/19f20081df059fef87e14c8e953669bd173dd7f1/src/backend/utils/errcodes.txt","record_count":247,"release":"11.0","release_date":null,"repository":"https://github.com/postgres/postgres.git","sha256":"8518be6de92ae135765e295c631c5f525120ca2b132453404b620f9aa595cab4","size":31453,"source_format":"errcodes.txt","source_role":"primary_definition","tag":"REL_11_0","url":"https://github.com/postgres/postgres/blob/19f20081df059fef87e14c8e953669bd173dd7f1/src/backend/utils/errcodes.txt","version":"11.0"},{"blob_id":"sha256:943259f3e36af1343dd0f090f7c7cec0e8c762b038d68c178aaa9b1b11999bfb","channel":"formal","code_count":257,"commit":"ad1f2885b8c82e0c2d56d7974f012cbecce17a17","id":"postgresql:REL_12_0:src/backend/utils/errcodes.txt","major":"12","parsed_path":"raw/definitions/REL_12_0.parsed.json","path":"src/backend/utils/errcodes.txt","raw_path":"raw/definitions/REL_12_0.txt","raw_url":"https://raw.githubusercontent.com/postgres/postgres/ad1f2885b8c82e0c2d56d7974f012cbecce17a17/src/backend/utils/errcodes.txt","record_count":263,"release":"12.0","release_date":null,"repository":"https://github.com/postgres/postgres.git","sha256":"943259f3e36af1343dd0f090f7c7cec0e8c762b038d68c178aaa9b1b11999bfb","size":33114,"source_format":"errcodes.txt","source_role":"primary_definition","tag":"REL_12_0","url":"https://github.com/postgres/postgres/blob/ad1f2885b8c82e0c2d56d7974f012cbecce17a17/src/backend/utils/errcodes.txt","version":"12.0"},{"blob_id":"sha256:9a464a3c3c99d2488782d4cdd0d46ce261085a944cb0c21e2d884586fbc8204d","channel":"formal","code_count":258,"commit":"29be9983a64c011eac0b9ee29895cce71e15ea77","id":"postgresql:REL_13_0:src/backend/utils/errcodes.txt","major":"13","parsed_path":"raw/definitions/REL_13_0.parsed.json","path":"src/backend/utils/errcodes.txt","raw_path":"raw/definitions/REL_13_0.txt","raw_url":"https://raw.githubusercontent.com/postgres/postgres/29be9983a64c011eac0b9ee29895cce71e15ea77/src/backend/utils/errcodes.txt","record_count":264,"release":"13.0","release_date":null,"repository":"https://github.com/postgres/postgres.git","sha256":"9a464a3c3c99d2488782d4cdd0d46ce261085a944cb0c21e2d884586fbc8204d","size":33239,"source_format":"errcodes.txt","source_role":"primary_definition","tag":"REL_13_0","url":"https://github.com/postgres/postgres/blob/29be9983a64c011eac0b9ee29895cce71e15ea77/src/backend/utils/errcodes.txt","version":"13.0"},{"blob_id":"sha256:c3c967fa20577f7ded946cb99e1a4706b85bb2476fd32d7e4a133c971a603552","channel":"formal","code_count":259,"commit":"86a4dc1e6f29d1992a2afa3fac1a0b0a6e84568c","id":"postgresql:REL_14_0:src/backend/utils/errcodes.txt","major":"14","parsed_path":"raw/definitions/REL_14_0.parsed.json","path":"src/backend/utils/errcodes.txt","raw_path":"raw/definitions/REL_14_0.txt","raw_url":"https://raw.githubusercontent.com/postgres/postgres/86a4dc1e6f29d1992a2afa3fac1a0b0a6e84568c/src/backend/utils/errcodes.txt","record_count":265,"release":"14.0","release_date":null,"repository":"https://github.com/postgres/postgres.git","sha256":"c3c967fa20577f7ded946cb99e1a4706b85bb2476fd32d7e4a133c971a603552","size":33337,"source_format":"errcodes.txt","source_role":"primary_definition","tag":"REL_14_0","url":"https://github.com/postgres/postgres/blob/86a4dc1e6f29d1992a2afa3fac1a0b0a6e84568c/src/backend/utils/errcodes.txt","version":"14.0"},{"blob_id":"sha256:a34b5fccd8a27c92817314dd942b79e76896cd1d9a8d4be21c81b02227850b4a","channel":"formal","code_count":260,"commit":"2a7ce2e2ce474504a707ec03e128fde66cfb8b48","id":"postgresql:REL_15_0:src/backend/utils/errcodes.txt","major":"15","parsed_path":"raw/definitions/REL_15_0.parsed.json","path":"src/backend/utils/errcodes.txt","raw_path":"raw/definitions/REL_15_0.txt","raw_url":"https://raw.githubusercontent.com/postgres/postgres/2a7ce2e2ce474504a707ec03e128fde66cfb8b48/src/backend/utils/errcodes.txt","record_count":266,"release":"15.0","release_date":null,"repository":"https://github.com/postgres/postgres.git","sha256":"a34b5fccd8a27c92817314dd942b79e76896cd1d9a8d4be21c81b02227850b4a","size":33458,"source_format":"errcodes.txt","source_role":"primary_definition","tag":"REL_15_0","url":"https://github.com/postgres/postgres/blob/2a7ce2e2ce474504a707ec03e128fde66cfb8b48/src/backend/utils/errcodes.txt","version":"15.0"},{"blob_id":"sha256:1d1d741b7b7c6dfd8275287e31c79befed75f3b9349e1a42ef0ca147c429ff88","channel":"formal","code_count":260,"commit":"c372fbbd8e911f2412b80a8c39d7079366565d67","id":"postgresql:REL_16_0:src/backend/utils/errcodes.txt","major":"16","parsed_path":"raw/definitions/REL_16_0.parsed.json","path":"src/backend/utils/errcodes.txt","raw_path":"raw/definitions/REL_16_0.txt","raw_url":"https://raw.githubusercontent.com/postgres/postgres/c372fbbd8e911f2412b80a8c39d7079366565d67/src/backend/utils/errcodes.txt","record_count":266,"release":"16.0","release_date":null,"repository":"https://github.com/postgres/postgres.git","sha256":"1d1d741b7b7c6dfd8275287e31c79befed75f3b9349e1a42ef0ca147c429ff88","size":33458,"source_format":"errcodes.txt","source_role":"primary_definition","tag":"REL_16_0","url":"https://github.com/postgres/postgres/blob/c372fbbd8e911f2412b80a8c39d7079366565d67/src/backend/utils/errcodes.txt","version":"16.0"},{"blob_id":"sha256:bb53279934510355eb4135a807c90d989f07650bd90f87026a4441f11d3296b1","channel":"formal","code_count":260,"commit":"d7ec59a63d745ba74fba0e280bbf85dc6d1caa3e","id":"postgresql:REL_17_0:src/backend/utils/errcodes.txt","major":"17","parsed_path":"raw/definitions/REL_17_0.parsed.json","path":"src/backend/utils/errcodes.txt","raw_path":"raw/definitions/REL_17_0.txt","raw_url":"https://raw.githubusercontent.com/postgres/postgres/d7ec59a63d745ba74fba0e280bbf85dc6d1caa3e/src/backend/utils/errcodes.txt","record_count":266,"release":"17.0","release_date":null,"repository":"https://github.com/postgres/postgres.git","sha256":"bb53279934510355eb4135a807c90d989f07650bd90f87026a4441f11d3296b1","size":33392,"source_format":"errcodes.txt","source_role":"primary_definition","tag":"REL_17_0","url":"https://github.com/postgres/postgres/blob/d7ec59a63d745ba74fba0e280bbf85dc6d1caa3e/src/backend/utils/errcodes.txt","version":"17.0"},{"blob_id":"sha256:6e8de346643ba84aa3c9c6a73360acfc7b2dfb89162c06c08ce9bf5bcd5bbcba","channel":"formal","code_count":262,"commit":"3d6a828938a5fa0444275d3d2f67b64ec3199eb7","id":"postgresql:REL_18_0:src/backend/utils/errcodes.txt","major":"18","parsed_path":"raw/definitions/REL_18_0.parsed.json","path":"src/backend/utils/errcodes.txt","raw_path":"raw/definitions/REL_18_0.txt","raw_url":"https://raw.githubusercontent.com/postgres/postgres/3d6a828938a5fa0444275d3d2f67b64ec3199eb7/src/backend/utils/errcodes.txt","record_count":268,"release":"18.0","release_date":null,"repository":"https://github.com/postgres/postgres.git","sha256":"6e8de346643ba84aa3c9c6a73360acfc7b2dfb89162c06c08ce9bf5bcd5bbcba","size":33739,"source_format":"errcodes.txt","source_role":"primary_definition","tag":"REL_18_0","url":"https://github.com/postgres/postgres/blob/3d6a828938a5fa0444275d3d2f67b64ec3199eb7/src/backend/utils/errcodes.txt","version":"18.0"},{"blob_id":"sha256:cadb9e83cde9a8699a7e74448891ca623af8579ccc8e11c7e533fb47cbc42f89","channel":"preview","code_count":262,"commit":"3638289fb57bdabec00deda98ee9624a35f5d66a","id":"postgresql:REL_19_BETA3:src/backend/utils/errcodes.txt","major":"19","parsed_path":"raw/definitions/REL_19_BETA3.parsed.json","path":"src/backend/utils/errcodes.txt","raw_path":"raw/definitions/REL_19_BETA3.txt","raw_url":"https://raw.githubusercontent.com/postgres/postgres/3638289fb57bdabec00deda98ee9624a35f5d66a/src/backend/utils/errcodes.txt","record_count":268,"release":"19beta3","release_date":"2026-08-13","repository":"https://github.com/postgres/postgres.git","sha256":"cadb9e83cde9a8699a7e74448891ca623af8579ccc8e11c7e533fb47cbc42f89","size":33739,"source_format":"errcodes.txt","source_role":"primary_definition","tag":"REL_19_BETA3","url":"https://github.com/postgres/postgres/blob/3638289fb57bdabec00deda98ee9624a35f5d66a/src/backend/utils/errcodes.txt","version":"19beta3"}],"sqlstate":"P0004","status":"active","usage_evidence":[{"evidence_ids":["postgresql:REL9_5_0:src/backend/utils/errcodes.txt","postgresql:REL9_5_10:src/backend/utils/errcodes.txt","postgresql:REL9_5_11:src/backend/utils/errcodes.txt","postgresql:REL9_5_12:src/backend/utils/errcodes.txt","postgresql:REL9_5_13:src/backend/utils/errcodes.txt","postgresql:REL9_5_14:src/backend/utils/errcodes.txt","postgresql:REL9_5_15:src/backend/utils/errcodes.txt","postgresql:REL9_5_16:src/backend/utils/errcodes.txt","postgresql:REL9_5_17:src/backend/utils/errcodes.txt","postgresql:REL9_5_18:src/backend/utils/errcodes.txt","postgresql:REL9_5_19:src/backend/utils/errcodes.txt","postgresql:REL9_5_1:src/backend/utils/errcodes.txt","postgresql:REL9_5_20:src/backend/utils/errcodes.txt","postgresql:REL9_5_21:src/backend/utils/errcodes.txt","postgresql:REL9_5_22:src/backend/utils/errcodes.txt","postgresql:REL9_5_23:src/backend/utils/errcodes.txt","postgresql:REL9_5_24:src/backend/utils/errcodes.txt","postgresql:REL9_5_25:src/backend/utils/errcodes.txt","postgresql:REL9_5_2:src/backend/utils/errcodes.txt","postgresql:REL9_5_3:src/backend/utils/errcodes.txt","postgresql:REL9_5_4:src/backend/utils/errcodes.txt","postgresql:REL9_5_5:src/backend/utils/errcodes.txt","postgresql:REL9_5_6:src/backend/utils/errcodes.txt","postgresql:REL9_5_7:src/backend/utils/errcodes.txt","postgresql:REL9_5_8:src/backend/utils/errcodes.txt","postgresql:REL9_5_9:src/backend/utils/errcodes.txt","postgresql:REL9_6_0:src/backend/utils/errcodes.txt","postgresql:REL9_6_10:src/backend/utils/errcodes.txt","postgresql:REL9_6_11:src/backend/utils/errcodes.txt","postgresql:REL9_6_12:src/backend/utils/errcodes.txt","postgresql:REL9_6_13:src/backend/utils/errcodes.txt","postgresql:REL9_6_14:src/backend/utils/errcodes.txt","postgresql:REL9_6_15:src/backend/utils/errcodes.txt","postgresql:REL9_6_16:src/backend/utils/errcodes.txt","postgresql:REL9_6_17:src/backend/utils/errcodes.txt","postgresql:REL9_6_18:src/backend/utils/errcodes.txt","postgresql:REL9_6_19:src/backend/utils/errcodes.txt","postgresql:REL9_6_1:src/backend/utils/errcodes.txt","postgresql:REL9_6_20:src/backend/utils/errcodes.txt","postgresql:REL9_6_21:src/backend/utils/errcodes.txt","postgresql:REL9_6_22:src/backend/utils/errcodes.txt","postgresql:REL9_6_23:src/backend/utils/errcodes.txt","postgresql:REL9_6_24:src/backend/utils/errcodes.txt","postgresql:REL9_6_2:src/backend/utils/errcodes.txt","postgresql:REL9_6_3:src/backend/utils/errcodes.txt","postgresql:REL9_6_4:src/backend/utils/errcodes.txt","postgresql:REL9_6_5:src/backend/utils/errcodes.txt","postgresql:REL9_6_6:src/backend/utils/errcodes.txt","postgresql:REL9_6_7:src/backend/utils/errcodes.txt","postgresql:REL9_6_8:src/backend/utils/errcodes.txt","postgresql:REL9_6_9:src/backend/utils/errcodes.txt","postgresql:REL_10_0:src/backend/utils/errcodes.txt","postgresql:REL_10_10:src/backend/utils/errcodes.txt","postgresql:REL_10_11:src/backend/utils/errcodes.txt","postgresql:REL_10_12:src/backend/utils/errcodes.txt","postgresql:REL_10_13:src/backend/utils/errcodes.txt","postgresql:REL_10_14:src/backend/utils/errcodes.txt","postgresql:REL_10_15:src/backend/utils/errcodes.txt","postgresql:REL_10_16:src/backend/utils/errcodes.txt","postgresql:REL_10_17:src/backend/utils/errcodes.txt","postgresql:REL_10_18:src/backend/utils/errcodes.txt","postgresql:REL_10_19:src/backend/utils/errcodes.txt","postgresql:REL_10_1:src/backend/utils/errcodes.txt","postgresql:REL_10_20:src/backend/utils/errcodes.txt","postgresql:REL_10_21:src/backend/utils/errcodes.txt","postgresql:REL_10_22:src/backend/utils/errcodes.txt","postgresql:REL_10_23:src/backend/utils/errcodes.txt","postgresql:REL_10_2:src/backend/utils/errcodes.txt","postgresql:REL_10_3:src/backend/utils/errcodes.txt","postgresql:REL_10_4:src/backend/utils/errcodes.txt","postgresql:REL_10_5:src/backend/utils/errcodes.txt","postgresql:REL_10_6:src/backend/utils/errcodes.txt","postgresql:REL_10_7:src/backend/utils/errcodes.txt","postgresql:REL_10_8:src/backend/utils/errcodes.txt","postgresql:REL_10_9:src/backend/utils/errcodes.txt","postgresql:REL_11_0:src/backend/utils/errcodes.txt","postgresql:REL_11_10:src/backend/utils/errcodes.txt","postgresql:REL_11_11:src/backend/utils/errcodes.txt","postgresql:REL_11_12:src/backend/utils/errcodes.txt","postgresql:REL_11_13:src/backend/utils/errcodes.txt","postgresql:REL_11_14:src/backend/utils/errcodes.txt","postgresql:REL_11_15:src/backend/utils/errcodes.txt","postgresql:REL_11_16:src/backend/utils/errcodes.txt","postgresql:REL_11_17:src/backend/utils/errcodes.txt","postgresql:REL_11_18:src/backend/utils/errcodes.txt","postgresql:REL_11_19:src/backend/utils/errcodes.txt","postgresql:REL_11_1:src/backend/utils/errcodes.txt","postgresql:REL_11_20:src/backend/utils/errcodes.txt","postgresql:REL_11_21:src/backend/utils/errcodes.txt","postgresql:REL_11_22:src/backend/utils/errcodes.txt","postgresql:REL_11_2:src/backend/utils/errcodes.txt","postgresql:REL_11_3:src/backend/utils/errcodes.txt","postgresql:REL_11_4:src/backend/utils/errcodes.txt","postgresql:REL_11_5:src/backend/utils/errcodes.txt","postgresql:REL_11_6:src/backend/utils/errcodes.txt","postgresql:REL_11_7:src/backend/utils/errcodes.txt","postgresql:REL_11_8:src/backend/utils/errcodes.txt","postgresql:REL_11_9:src/backend/utils/errcodes.txt","postgresql:REL_12_0:src/backend/utils/errcodes.txt","postgresql:REL_12_10:src/backend/utils/errcodes.txt","postgresql:REL_12_11:src/backend/utils/errcodes.txt","postgresql:REL_12_12:src/backend/utils/errcodes.txt","postgresql:REL_12_13:src/backend/utils/errcodes.txt","postgresql:REL_12_14:src/backend/utils/errcodes.txt","postgresql:REL_12_15:src/backend/utils/errcodes.txt","postgresql:REL_12_16:src/backend/utils/errcodes.txt","postgresql:REL_12_17:src/backend/utils/errcodes.txt","postgresql:REL_12_18:src/backend/utils/errcodes.txt","postgresql:REL_12_19:src/backend/utils/errcodes.txt","postgresql:REL_12_1:src/backend/utils/errcodes.txt","postgresql:REL_12_20:src/backend/utils/errcodes.txt","postgresql:REL_12_21:src/backend/utils/errcodes.txt","postgresql:REL_12_22:src/backend/utils/errcodes.txt","postgresql:REL_12_2:src/backend/utils/errcodes.txt","postgresql:REL_12_3:src/backend/utils/errcodes.txt","postgresql:REL_12_4:src/backend/utils/errcodes.txt","postgresql:REL_12_5:src/backend/utils/errcodes.txt","postgresql:REL_12_6:src/backend/utils/errcodes.txt","postgresql:REL_12_7:src/backend/utils/errcodes.txt","postgresql:REL_12_8:src/backend/utils/errcodes.txt","postgresql:REL_12_9:src/backend/utils/errcodes.txt","postgresql:REL_13_0:src/backend/utils/errcodes.txt","postgresql:REL_13_10:src/backend/utils/errcodes.txt","postgresql:REL_13_11:src/backend/utils/errcodes.txt","postgresql:REL_13_12:src/backend/utils/errcodes.txt","postgresql:REL_13_13:src/backend/utils/errcodes.txt","postgresql:REL_13_14:src/backend/utils/errcodes.txt","postgresql:REL_13_15:src/backend/utils/errcodes.txt","postgresql:REL_13_16:src/backend/utils/errcodes.txt","postgresql:REL_13_17:src/backend/utils/errcodes.txt","postgresql:REL_13_18:src/backend/utils/errcodes.txt","postgresql:REL_13_19:src/backend/utils/errcodes.txt","postgresql:REL_13_1:src/backend/utils/errcodes.txt","postgresql:REL_13_20:src/backend/utils/errcodes.txt","postgresql:REL_13_21:src/backend/utils/errcodes.txt","postgresql:REL_13_22:src/backend/utils/errcodes.txt","postgresql:REL_13_23:src/backend/utils/errcodes.txt","postgresql:REL_13_2:src/backend/utils/errcodes.txt","postgresql:REL_13_3:src/backend/utils/errcodes.txt","postgresql:REL_13_4:src/backend/utils/errcodes.txt","postgresql:REL_13_5:src/backend/utils/errcodes.txt","postgresql:REL_13_6:src/backend/utils/errcodes.txt","postgresql:REL_13_7:src/backend/utils/errcodes.txt","postgresql:REL_13_8:src/backend/utils/errcodes.txt","postgresql:REL_13_9:src/backend/utils/errcodes.txt","postgresql:REL_14_0:src/backend/utils/errcodes.txt","postgresql:REL_14_10:src/backend/utils/errcodes.txt","postgresql:REL_14_11:src/backend/utils/errcodes.txt","postgresql:REL_14_12:src/backend/utils/errcodes.txt","postgresql:REL_14_13:src/backend/utils/errcodes.txt","postgresql:REL_14_14:src/backend/utils/errcodes.txt","postgresql:REL_14_15:src/backend/utils/errcodes.txt","postgresql:REL_14_16:src/backend/utils/errcodes.txt","postgresql:REL_14_17:src/backend/utils/errcodes.txt","postgresql:REL_14_18:src/backend/utils/errcodes.txt","postgresql:REL_14_19:src/backend/utils/errcodes.txt","postgresql:REL_14_1:src/backend/utils/errcodes.txt","postgresql:REL_14_20:src/backend/utils/errcodes.txt","postgresql:REL_14_21:src/backend/utils/errcodes.txt","postgresql:REL_14_22:src/backend/utils/errcodes.txt","postgresql:REL_14_23:src/backend/utils/errcodes.txt","postgresql:REL_14_24:src/backend/utils/errcodes.txt","postgresql:REL_14_2:src/backend/utils/errcodes.txt","postgresql:REL_14_3:src/backend/utils/errcodes.txt","postgresql:REL_14_4:src/backend/utils/errcodes.txt","postgresql:REL_14_5:src/backend/utils/errcodes.txt","postgresql:REL_14_6:src/backend/utils/errcodes.txt","postgresql:REL_14_7:src/backend/utils/errcodes.txt","postgresql:REL_14_8:src/backend/utils/errcodes.txt","postgresql:REL_14_9:src/backend/utils/errcodes.txt","postgresql:REL_15_0:src/backend/utils/errcodes.txt","postgresql:REL_15_10:src/backend/utils/errcodes.txt","postgresql:REL_15_11:src/backend/utils/errcodes.txt","postgresql:REL_15_12:src/backend/utils/errcodes.txt","postgresql:REL_15_13:src/backend/utils/errcodes.txt","postgresql:REL_15_14:src/backend/utils/errcodes.txt","postgresql:REL_15_15:src/backend/utils/errcodes.txt","postgresql:REL_15_16:src/backend/utils/errcodes.txt","postgresql:REL_15_17:src/backend/utils/errcodes.txt","postgresql:REL_15_18:src/backend/utils/errcodes.txt","postgresql:REL_15_19:src/backend/utils/errcodes.txt","postgresql:REL_15_1:src/backend/utils/errcodes.txt","postgresql:REL_15_2:src/backend/utils/errcodes.txt","postgresql:REL_15_3:src/backend/utils/errcodes.txt","postgresql:REL_15_4:src/backend/utils/errcodes.txt","postgresql:REL_15_5:src/backend/utils/errcodes.txt","postgresql:REL_15_6:src/backend/utils/errcodes.txt","postgresql:REL_15_7:src/backend/utils/errcodes.txt","postgresql:REL_15_8:src/backend/utils/errcodes.txt","postgresql:REL_15_9:src/backend/utils/errcodes.txt","postgresql:REL_16_0:src/backend/utils/errcodes.txt","postgresql:REL_16_10:src/backend/utils/errcodes.txt","postgresql:REL_16_11:src/backend/utils/errcodes.txt","postgresql:REL_16_12:src/backend/utils/errcodes.txt","postgresql:REL_16_13:src/backend/utils/errcodes.txt","postgresql:REL_16_14:src/backend/utils/errcodes.txt","postgresql:REL_16_15:src/backend/utils/errcodes.txt","postgresql:REL_16_1:src/backend/utils/errcodes.txt","postgresql:REL_16_2:src/backend/utils/errcodes.txt","postgresql:REL_16_3:src/backend/utils/errcodes.txt","postgresql:REL_16_4:src/backend/utils/errcodes.txt","postgresql:REL_16_5:src/backend/utils/errcodes.txt","postgresql:REL_16_6:src/backend/utils/errcodes.txt","postgresql:REL_16_7:src/backend/utils/errcodes.txt","postgresql:REL_16_8:src/backend/utils/errcodes.txt","postgresql:REL_16_9:src/backend/utils/errcodes.txt","postgresql:REL_17_0:src/backend/utils/errcodes.txt","postgresql:REL_17_10:src/backend/utils/errcodes.txt","postgresql:REL_17_11:src/backend/utils/errcodes.txt","postgresql:REL_17_1:src/backend/utils/errcodes.txt","postgresql:REL_17_2:src/backend/utils/errcodes.txt","postgresql:REL_17_3:src/backend/utils/errcodes.txt","postgresql:REL_17_4:src/backend/utils/errcodes.txt","postgresql:REL_17_5:src/backend/utils/errcodes.txt","postgresql:REL_17_6:src/backend/utils/errcodes.txt","postgresql:REL_17_7:src/backend/utils/errcodes.txt","postgresql:REL_17_8:src/backend/utils/errcodes.txt","postgresql:REL_17_9:src/backend/utils/errcodes.txt","postgresql:REL_18_0:src/backend/utils/errcodes.txt","postgresql:REL_18_1:src/backend/utils/errcodes.txt","postgresql:REL_18_2:src/backend/utils/errcodes.txt","postgresql:REL_18_3:src/backend/utils/errcodes.txt","postgresql:REL_18_4:src/backend/utils/errcodes.txt","postgresql:REL_18_6:src/backend/utils/errcodes.txt","postgresql:REL_19_BETA3:src/backend/utils/errcodes.txt"],"notes":"Presence in a PostgreSQL release definition file is established; runtime throw/use scanning is maintained separately.","scope":"release-definition-catalogue","status":"definition_only"},{"evidence_ids":[],"notes":"No occurrence was found in the locked 7.4..8.4 definition files; 7.0..7.3 source gaps remain explicit.","scope":"pre9-definition-history","status":"unknown"}]},"Evidence":[{"Kind":"cases","Ordinal":0,"ID":"assertion_failure_recovery","ServerVersion":null,"Status":null,"Payload":{"assertions":["The natural ASSERT failure has SQLSTATE P0004 and the expected diagnostic.","The failed explicit transaction is INERROR and ROLLBACK returns it to IDLE.","A valid call succeeds after rollback, and an explicit check_asserts=off control suppresses the assertion.","Re-enabling check_asserts makes the valid call succeed and the runner cleans up."],"case_id":"assertion_failure_recovery","cleanup":"Drop the case schema with an owner connection.","has_snippet":true,"position":0,"preconditions":["A disposable runner target has PL/pgSQL available.","plpgsql.check_asserts is explicitly enabled before the trigger."],"repair":"Rollback the failed transaction, use a valid input, and keep assertions enabled for production behavior.","trigger":"Call a PL/pgSQL function whose ASSERT condition is false inside an explicit transaction.","versions":["10","18"]}},{"Kind":"claims","Ordinal":0,"ID":"identity","ServerVersion":null,"Status":null,"Payload":{"claim_id":"identity","limits":"","method":"Read the fixed definition row.","position":0,"runtime":[],"sources":["src.errcodes.18.6"],"statement":"P0004 is assert_failure in PostgreSQL-specific Class P0."}},{"Kind":"claims","Ordinal":1,"ID":"assert-path","ServerVersion":null,"Status":null,"Payload":{"claim_id":"assert-path","limits":"","method":"Read the fixed `ASSERT` execution path and both errmsg branches.","position":1,"runtime":[],"sources":["src.path.plpgsql"],"statement":"PL/pgSQL assertion execution reports P0004 at ERROR level, using the evaluated message when present and `assertion failed` when no message is supplied."}},{"Kind":"claims","Ordinal":2,"ID":"runtime.assertion-case","ServerVersion":null,"Status":null,"Payload":{"claim_id":"runtime.assertion-case","limits":"This is a bounded case for the shared function and ASSERT setting; it does not establish behavior for arbitrary assertion messages or non-PL/pgSQL code.","method":"Read both target summaries and the fixed snippet registry.","position":2,"runtime":[],"sources":["runtime.P0004-same-session-latest-final.latest","runtime.P0004-same-session-pg10-final.pg10","snippet-registry.P0004"],"statement":"The shared assertion_failure_recovery case passed on PostgreSQL 18.6 and PostgreSQL 10.21: the false ASSERT returned P0004 with value must be positive, the explicit transaction was INERROR until ROLLBACK, a valid input succeeded, and the disabled-assert control returned zero."}},{"Kind":"claims","Ordinal":3,"ID":"runtime.diagnostics","ServerVersion":null,"Status":null,"Payload":{"claim_id":"runtime.diagnostics","limits":"","method":"Compare structured diagnostics in both target summaries.","position":3,"runtime":[],"sources":["runtime.P0004-same-session-latest-final.latest","runtime.P0004-same-session-pg10-final.pg10"],"statement":"The latest target recorded ERROR/P0004 from exec_stmt_assert at pl_exec.c:3968 with context at ASSERT; the PG10 target recorded the same SQLSTATE and diagnostic with its version-specific source line."}},{"Kind":"claims","Ordinal":4,"ID":"assert-semantics","ServerVersion":null,"Status":null,"Payload":{"claim_id":"assert-semantics","limits":"","method":"Read the fixed executor branch and the official PL/pgSQL ASSERT documentation.","position":4,"runtime":[],"sources":["src.path.plpgsql","doc.plpgsql.18"],"statement":"The fixed PL/pgSQL ASSERT path reports P0004 when its Boolean condition evaluates false or NULL; the supplied message expression is used as primary text, otherwise the executor uses assertion failed."}},{"Kind":"claims","Ordinal":5,"ID":"settings-and-handler-boundary","ServerVersion":null,"Status":null,"Payload":{"claim_id":"settings-and-handler-boundary","limits":"The setting is session-scoped; this claim does not make a connection-level setting change global.","method":"Read the PL/pgSQL control-structures error-trapping section for EXCEPTION subtransactions and condition matching; read the fixed executor for the session setting boundary.","position":5,"runtime":[],"sources":["doc.plpgsql-control.18","src.path.plpgsql"],"statement":"plpgsql.check_asserts controls assertion checking for the session, and the PL/pgSQL handler rules exclude ASSERT_FAILURE from WHEN OTHERS while allowing a named ASSERT_FAILURE condition."}},{"Kind":"claims","Ordinal":6,"ID":"transaction-recovery","ServerVersion":null,"Status":null,"Payload":{"claim_id":"transaction-recovery","limits":"","method":"Read both passed target summaries and the ordered shared registry.","position":6,"runtime":[],"sources":["runtime.P0004-same-session-latest-final.latest","runtime.P0004-same-session-pg10-final.pg10","snippet-registry.P0004"],"statement":"The observed case entered INERROR after P0004, returned to IDLE after ROLLBACK, and then accepted a valid call; disabling check_asserts suppressed the false assertion in the control branch."}},{"Kind":"messages","Ordinal":0,"ID":"message.assert","ServerVersion":null,"Status":null,"Payload":{"limits":"","message_id":"message.assert","path":"","position":0,"raw":{"alternate_template":"%s","id":"message.assert","primary_template":"assertion failed","severity_source":"ERROR","sources":["src.path.plpgsql"],"sqlstate":"P0004"},"severity":"ERROR","sources":["src.path.plpgsql"],"templates":[{"kind":"primary","literal":"assertion failed","position":0,"role":"","template":"assertion failed"},{"kind":"primary","literal":"","position":1,"role":"alternate","template":"%s"}]}},{"Kind":"runtimes","Ordinal":0,"ID":"runtime.P0004-same-session-latest-final.latest","ServerVersion":"18.6 (Homebrew)","Status":"passed","Payload":{"cases":["assertion_failure_recovery"],"limits":"","position":0,"raw":{"cases":["assertion_failure_recovery"],"id":"runtime.P0004-same-session-latest-final.latest","observed":{"after_error":"INERROR","after_rollback":"IDLE","disabled_control_result":0,"message_primary":"value must be positive","repair_result":1,"severity":"ERROR","sqlstate":"P0004"},"raw":"verify/results/P0004-same-session-latest-final/latest/raw.jsonl","raw_sha256":"2b03b5469ea34a0e49ad4a71e93cef4b19df0d01d86fc1156e478d88bc93168c","run_id":"P0004-same-session-latest-final","server_version":"18.6 (Homebrew)","server_version_num":180006,"status":"passed","summary":"verify/results/P0004-same-session-latest-final/latest/summary.json","summary_sha256":"5246ae67ee8dd29e769c3a03db7bfb6cde2f201c9f45993201fb269cc53988ad","target":"latest"},"run_id":"P0004-same-session-latest-final","runtime_id":"runtime.P0004-same-session-latest-final.latest","server_version":"18.6 (Homebrew)","status":"passed","target":"latest"}},{"Kind":"runtimes","Ordinal":1,"ID":"runtime.P0004-same-session-pg10-final.pg10","ServerVersion":"10.21 (Debian 10.21-1.pgdg90+1)","Status":"passed","Payload":{"cases":["assertion_failure_recovery"],"limits":"","position":1,"raw":{"cases":["assertion_failure_recovery"],"id":"runtime.P0004-same-session-pg10-final.pg10","observed":{"after_error":"INERROR","after_rollback":"IDLE","disabled_control_result":0,"message_primary":"value must be positive","repair_result":1,"severity":"ERROR","sqlstate":"P0004"},"raw":"verify/results/P0004-same-session-pg10-final/pg10/raw.jsonl","raw_sha256":"2369b62eb7c22d99122c9929134a878f2f3c0fe828887ae657f87b7b95e07ac8","run_id":"P0004-same-session-pg10-final","server_version":"10.21 (Debian 10.21-1.pgdg90+1)","server_version_num":100021,"status":"passed","summary":"verify/results/P0004-same-session-pg10-final/pg10/summary.json","summary_sha256":"50819f9620584f17766ffb62e2bb1c14e5aaa9162f91ec6cd26795cced3e6d30","target":"pg10"},"run_id":"P0004-same-session-pg10-final","runtime_id":"runtime.P0004-same-session-pg10-final.pg10","server_version":"10.21 (Debian 10.21-1.pgdg90+1)","status":"passed","target":"pg10"}},{"Kind":"sources","Ordinal":0,"ID":"src.errcodes.18.6","ServerVersion":null,"Status":null,"Payload":{"commit":"724edf9bde9d356724ad384a2e196edc3c9f80f7","docs_url":"","kind":"upstream_source","location":"","path":"src/backend/utils/errcodes.txt","position":0,"sha256":"6e8de346643ba84aa3c9c6a73360acfc7b2dfb89162c06c08ce9bf5bcd5bbcba","source_id":"src.errcodes.18.6","tag":"REL_18_6","url":"https://github.com/postgres/postgres/blob/724edf9bde9d356724ad384a2e196edc3c9f80f7/src/backend/utils/errcodes.txt#L494"}},{"Kind":"sources","Ordinal":1,"ID":"src.calls.REL_18_6","ServerVersion":null,"Status":null,"Payload":{"commit":"","docs_url":"","kind":"local_artifact","location":"","path":"raw/calls/REL_18_6.jsonl","position":1,"sha256":"9ee8a0e81d8f0825c5c1ae45583439859a26e602bdd4ce2f2a62aa278867ccbf","source_id":"src.calls.REL_18_6","tag":"","url":""}},{"Kind":"sources","Ordinal":2,"ID":"src.path.plpgsql","ServerVersion":null,"Status":null,"Payload":{"commit":"724edf9bde9d356724ad384a2e196edc3c9f80f7","docs_url":"","kind":"upstream_source","location":"","path":"src/pl/plpgsql/src/pl_exec.c","position":2,"sha256":"0df3c70a6bccf6dddf443fb99e152a16a67009827c44a820597e98e585cb8b20","source_id":"src.path.plpgsql","tag":"REL_18_6","url":"https://github.com/postgres/postgres/blob/724edf9bde9d356724ad384a2e196edc3c9f80f7/src/pl/plpgsql/src/pl_exec.c#L3965-L3968"}},{"Kind":"sources","Ordinal":3,"ID":"runtime.P0004-same-session-latest-final.latest","ServerVersion":null,"Status":null,"Payload":{"commit":"","docs_url":"","kind":"local_artifact","location":"","path":"verify/results/P0004-same-session-latest-final/latest/summary.json","position":3,"sha256":"5246ae67ee8dd29e769c3a03db7bfb6cde2f201c9f45993201fb269cc53988ad","source_id":"runtime.P0004-same-session-latest-final.latest","tag":"","url":""}},{"Kind":"sources","Ordinal":4,"ID":"runtime.P0004-same-session-latest-final.latest.raw","ServerVersion":null,"Status":null,"Payload":{"commit":"","docs_url":"","kind":"local_artifact","location":"","path":"verify/results/P0004-same-session-latest-final/latest/raw.jsonl","position":4,"sha256":"2b03b5469ea34a0e49ad4a71e93cef4b19df0d01d86fc1156e478d88bc93168c","source_id":"runtime.P0004-same-session-latest-final.latest.raw","tag":"","url":""}},{"Kind":"sources","Ordinal":5,"ID":"runtime.P0004-same-session-pg10-final.pg10","ServerVersion":null,"Status":null,"Payload":{"commit":"","docs_url":"","kind":"local_artifact","location":"","path":"verify/results/P0004-same-session-pg10-final/pg10/summary.json","position":5,"sha256":"50819f9620584f17766ffb62e2bb1c14e5aaa9162f91ec6cd26795cced3e6d30","source_id":"runtime.P0004-same-session-pg10-final.pg10","tag":"","url":""}},{"Kind":"sources","Ordinal":6,"ID":"runtime.P0004-same-session-pg10-final.pg10.raw","ServerVersion":null,"Status":null,"Payload":{"commit":"","docs_url":"","kind":"local_artifact","location":"","path":"verify/results/P0004-same-session-pg10-final/pg10/raw.jsonl","position":6,"sha256":"2369b62eb7c22d99122c9929134a878f2f3c0fe828887ae657f87b7b95e07ac8","source_id":"runtime.P0004-same-session-pg10-final.pg10.raw","tag":"","url":""}},{"Kind":"sources","Ordinal":7,"ID":"snippet-registry.P0004","ServerVersion":null,"Status":null,"Payload":{"commit":"","docs_url":"","kind":"local_artifact","location":"","path":"verify/cases/P0004/snippets.json","position":7,"sha256":"ef124f75ec61be666abc87ff431ebfb496dfa3352f78a3bee4432430dd68c229","source_id":"snippet-registry.P0004","tag":"","url":""}},{"Kind":"sources","Ordinal":8,"ID":"doc.plpgsql.18","ServerVersion":null,"Status":null,"Payload":{"commit":"724edf9bde9d356724ad384a2e196edc3c9f80f7","docs_url":"","kind":"upstream_source","location":"","path":"doc/src/sgml/plpgsql.sgml","position":8,"sha256":"43d705adbded343336341fd3e34ea8940432e8a8211f737d36ba3041ad0a4a51","source_id":"doc.plpgsql.18","tag":"PG18-docs","url":"https://www.postgresql.org/docs/18/plpgsql-errors-and-messages.html"}},{"Kind":"sources","Ordinal":9,"ID":"doc.plpgsql-control.18","ServerVersion":null,"Status":null,"Payload":{"commit":"724edf9bde9d356724ad384a2e196edc3c9f80f7","docs_url":"","kind":"upstream_source","location":"","path":"doc/src/sgml/plpgsql.sgml","position":9,"sha256":"43d705adbded343336341fd3e34ea8940432e8a8211f737d36ba3041ad0a4a51","source_id":"doc.plpgsql-control.18","tag":"PG18-docs","url":"https://www.postgresql.org/docs/18/plpgsql-control-structures.html#PLPGSQL-ERROR-TRAPPING"}}]}
