{"Entry":{"collection":"sqlstate","key":"25P04","name":"25P04","aliases":[],"metadata":{"aliases":[],"case_count":2,"class_code":"25","condition_name":"transaction_timeout","condition_names":["transaction_timeout"],"content_hash":"1d5e7f6895cb4e56744bc32e076e03bbc043a62bd5f69a181164c1c0de147e17","depth":"full","editorial_review":"reviewed","evidence_tier":"observed_runtime","imported_at":"2026-09-30T17:45:27.300917+08:00","introduced":null,"known_present_by":"17.0","macros":["ERRCODE_TRANSACTION_TIMEOUT"],"name_zh":"事务超时","present_in":["17","18","19"],"preview_in":["19"],"primary_macro":"ERRCODE_TRANSACTION_TIMEOUT","removed":null,"runtime_verification":"passed","severity_classes":["E"],"snippet_count":2,"source_rev":"english-manuals:978606527e6134aa67f519a3abfcd9b4b446e0fe2ac90ab13a12c74630d5908f","sqlstate":"25P04","status":"active","summary_zh":"事务运行超过 transaction_timeout 被终止。"}},"Definition":{"Collection":"sqlstate","Key":"25P04","SourceDatabase":"center","Version":"18","SourceTable":"sqlstate","SourceKey":"25P04","SourceRevision":"english-manuals:978606527e6134aa67f519a3abfcd9b4b446e0fe2ac90ab13a12c74630d5908f","Facts":{"aliases":[],"class_name":"Invalid Transaction State","condition_name":"transaction_timeout","doc":{"anchor":"ERRCODES-APPENDIX","file":"errcodes-appendix.html","lang":"en","sha256":"56dacf78e618ff0fd8c533e05db597b80d7ebbad7f8e512a888217d0640aa328","slug":"18"},"lang":"en","sqlstate":"25P04"},"ManualEvidence":{"doc":{"anchor":"ERRCODES-APPENDIX","file":"errcodes-appendix.html","lang":"en","sha256":"56dacf78e618ff0fd8c533e05db597b80d7ebbad7f8e512a888217d0640aa328","slug":"18"}},"MeasuredEvidence":{}},"Text":{"Collection":"sqlstate","Key":"25P04","SourceDatabase":"center","Version":"","Locale":"en","Title":"25P04 — transaction_timeout","Summary":"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.","BodyHTML":"\u003ch1\u003e25P04 — transaction_timeout\u003c/h1\u003e\n\u003ch2\u003eAt a glance {#at-a-glance}\u003c/h2\u003e\n\u003cp\u003e\u003ccode\u003e25P04\u003c/code\u003e is a FATAL condition emitted by \u003ccode\u003etransaction_timeout\u003c/code\u003e, which covers both an explicit \u003ccode\u003eBEGIN\u003c/code\u003e 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 \u003ccode\u003e42704\u003c/code\u003e on PG16 and natural FATAL \u003ccode\u003e25P04\u003c/code\u003e on PG17; it is separate from the selected base case.\u003c/p\u003e\n\u003ch2\u003eMeaning {#meaning}\u003c/h2\u003e\n\u003cp\u003e\u003ccode\u003etransaction_timeout\u003c/code\u003e limits the lifetime of an explicit or implicit transaction, including time spent executing or waiting while that transaction is open. When it fires, PostgreSQL emits \u003ccode\u003eterminating connection due to transaction timeout\u003c/code\u003e and terminates the session. It is different from \u003ccode\u003estatement_timeout\u003c/code\u003e, which aborts one statement, and from \u003ccode\u003eidle_in_transaction_session_timeout\u003c/code\u003e, which covers only client-idle time inside an open transaction. If \u003ccode\u003etransaction_timeout\u003c/code\u003e is shorter than or equal to either of those settings, the longer timeout is ignored; prepared transactions are not subject to it.\u003c/p\u003e\n\u003ch2\u003eDiagnosis {#diagnosis}\u003c/h2\u003e\n\u003cp\u003eOn a supported server, capture the effective \u003ccode\u003eSHOW transaction_timeout\u003c/code\u003e, \u003ccode\u003eSHOW statement_timeout\u003c/code\u003e, and \u003ccode\u003eSHOW idle_in_transaction_session_timeout\u003c/code\u003e values on the timed session itself. A control connection\u0026#39;s \u003ccode\u003eSHOW\u003c/code\u003e or \u003ccode\u003epg_settings\u003c/code\u003e describes the observer backend and cannot establish another session\u0026#39;s effective \u003ccode\u003eSET\u003c/code\u003e values. From the control connection inspect \u003ccode\u003epg_stat_activity\u003c/code\u003e fields such as \u003ccode\u003epid\u003c/code\u003e, \u003ccode\u003eapplication_name\u003c/code\u003e, \u003ccode\u003estate\u003c/code\u003e, \u003ccode\u003exact_start\u003c/code\u003e, \u003ccode\u003estate_change\u003c/code\u003e, \u003ccode\u003equery_start\u003c/code\u003e, and \u003ccode\u003equery\u003c/code\u003e to identify the owning application or pool and whether the transaction is active or idle. Match the collector record by backend PID, SQLSTATE 25P04, \u003ccode\u003eerror_severity = FATAL\u003c/code\u003e, and the exact message. In the selected 18.6 run the driver also exposed 25P04 and the original connection was closed; a fresh owner connection successfully ran \u003ccode\u003eSELECT 1\u003c/code\u003e. PG10 is skipped by the minimum-version preflight before \u003ccode\u003eSET transaction_timeout\u003c/code\u003e is sent.\u003c/p\u003e\n\u003ch2\u003eResponse {#response}\u003c/h2\u003e\n\u003cp\u003eDiscard the terminated session and reconnect. Keep legitimate transactions within the chosen budget by shortening work, splitting a long unit of work, or raising the effective timeout; do not lower it to hide the error. Set it to \u003ccode\u003e0\u003c/code\u003e only when the deployment deliberately accepts the absence of this guard. When the server closes the terminated session, it rolls back the open incomplete transaction before exiting; the dead connection cannot accept a later \u003ccode\u003eROLLBACK\u003c/code\u003e. A known transaction that had not committed on that session cannot be recovered through that connection. If a separate network failure left it uncertain whether \u003ccode\u003eCOMMIT\u003c/code\u003e reached the server, reconcile the business result from a fresh connection before retrying; the selected case sent no commit and does not establish that uncertainty. PG10 has no compatible setting in this batch.\u003c/p\u003e\n\u003ch2\u003eFATAL message {#messages}\u003c/h2\u003e\n\u003cp\u003eThe server source emits \u003ccode\u003eterminating connection due to transaction timeout\u003c/code\u003e at \u003ccode\u003eFATAL\u003c/code\u003e severity; the original connection is terminated.\u003c/p\u003e\n\u003ch2\u003eObserved diagnostics {#observed}\u003c/h2\u003e\n\u003cp\u003e\u003ccode\u003e18.6 (Homebrew) / latest\u003c/code\u003e: FATAL SQLSTATE \u003ccode\u003e25P04\u003c/code\u003e; primary \u003ccode\u003eterminating connection due to transaction timeout\u003c/code\u003e; backend PID \u003ccode\u003e30576\u003c/code\u003e; original connection closed \u003ccode\u003eTrue\u003c/code\u003e; collector CSV \u003ccode\u003e25P04\u003c/code\u003e; collector JSON \u003ccode\u003e25P04\u003c/code\u003e; fresh probe \u003ccode\u003e1\u003c/code\u003e.\n\u003ccode\u003e10.21 (Debian 10.21-1.pgdg90+1) / pg10\u003c/code\u003e: case \u003ccode\u003enot_applicable\u003c/code\u003e (minimum-version preflight; the unsupported setting was not probed).\u003c/p\u003e\n\u003cp\u003eSeparate boundary comparison: \u003ccode\u003e16.15 / pg16\u003c/code\u003e returned \u003ccode\u003e42704\u003c/code\u003e for unavailable \u003ccode\u003etransaction_timeout\u003c/code\u003e and remained \u003ccode\u003eIDLE\u003c/code\u003e, so it is not 25P04 coverage. \u003ccode\u003e17.11 / pg17\u003c/code\u003e produced FATAL \u003ccode\u003e25P04\u003c/code\u003e after 300 ms with backend PID \u003ccode\u003e73\u003c/code\u003e; CSV and JSON both recorded FATAL \u003ccode\u003e25P04\u003c/code\u003e, the original connection closed, and a fresh connection was \u003ccode\u003eIDLE\u003c/code\u003e. These records are outside the selected base case.\u003c/p\u003e\n\u003ch2\u003eRepresentative case {#case}\u003c/h2\u003e\n\u003cp\u003eThe SQL excerpt below is not a paste-all script: run the setting, PID, and \u003ccode\u003eBEGIN\u003c/code\u003e on a test connection, then stop sending it queries while a separate observer or log collector waits for FATAL; after the old connection is terminated, open a fresh owner connection for the final probe. The runner reads these statements from the shared registry; complete assertions, collector correlation, environment, and cleanup are in \u003ca href=\"#cases\" rel=\"nofollow\"\u003ecase export\u003c/a\u003e.\u003c/p\u003e\n\u003cpre\u003e\u003ccode\u003e-- set_timeout\nSET transaction_timeout = \u0026#39;300ms\u0026#39;;\n-- backend_pid\nSELECT pg_backend_pid();\n-- begin\nBEGIN;\n-- probe\nSELECT 1;\n\u003c/code\u003e\u003c/pre\u003e\n\u003cp\u003eThe SQLSTATE, diagnostics, states, and repair assertions for this excerpt come from the shared registry (SHA-256 \u003ccode\u003ed05a26e56716c5c8c178f741843e6b14be87423ec9d1eb1a026ff67a57ce4658\u003c/code\u003e); \u003ca href=\"#sources\" rel=\"nofollow\"\u003estructured evidence\u003c/a\u003e.\u003c/p\u003e\n\u003cp\u003eAuthored evidence IDs: \u003ccode\u003eidentity\u003c/code\u003e, \u003ccode\u003etimeout-path\u003c/code\u003e, \u003ccode\u003eruntime\u003c/code\u003e, \u003ccode\u003eruntime.version-boundary\u003c/code\u003e. Selected base runtime record: \u003ccode\u003eruntime.25P04-batch2c-latest-20260909.latest\u003c/code\u003e. Separate boundary records: \u003ccode\u003eruntime.25P04-boundary-pg16-20260909.pg16\u003c/code\u003e and \u003ccode\u003eruntime.25P04-boundary-pg17-20260909.pg17\u003c/code\u003e.\u003c/p\u003e\n\u003cp\u003eThe separate boundary comparison has already recorded the availability check: PG16 returned \u003ccode\u003e42704\u003c/code\u003e and PG17 continued to a natural FATAL \u003ccode\u003e25P04\u003c/code\u003e. This boundary block is branched, not a paste-all script. On PG16, run \u003ccode\u003eSHOW transaction_timeout\u003c/code\u003e; after the expected \u003ccode\u003e42704\u003c/code\u003e, use the same still-healthy connection for \u003ccode\u003eSELECT 1\u003c/code\u003e if you need to prove recovery, then stop and skip \u003ccode\u003eSET transaction_timeout\u003c/code\u003e, \u003ccode\u003eBEGIN\u003c/code\u003e, and the timeout wait. On PG17 or later, after \u003ccode\u003eSHOW\u003c/code\u003e succeeds, run \u003ccode\u003eSET transaction_timeout\u003c/code\u003e, capture the PID, and run \u003ccode\u003eBEGIN\u003c/code\u003e; then stop sending queries and let the observer or collector wait for the old connection\u0026#39;s FATAL and closure. Open a fresh connection only for the final probe. The boundary records are diagnostic comparisons and do not add to the selected base case count.\u003c/p\u003e\n\u003cpre\u003e\u003ccode\u003e-- availability_probe\nSHOW transaction_timeout;\n-- set_timeout\nSET transaction_timeout = \u0026#39;300ms\u0026#39;;\n-- backend_pid\nSELECT pg_backend_pid();\n-- begin\nBEGIN;\n-- probe\nSELECT 1;\n\u003c/code\u003e\u003c/pre\u003e\n\u003ch2\u003eVersions and limits {#versions}\u003c/h2\u003e\n\u003cp\u003eThe locked catalogue first observes \u003ccode\u003etransaction_timeout\u003c/code\u003e in 17.0. The selected 18.6 case passes with CSV/JSON collector evidence and a fresh-connection probe. The separate PG17.11 boundary case independently records natural FATAL \u003ccode\u003e25P04\u003c/code\u003e, while PG16.15 records unavailable-setting \u003ccode\u003e42704\u003c/code\u003e; neither replaces the selected base run. The PG10 case is a real \u003ccode\u003enot_applicable\u003c/code\u003e minimum-version preflight skip: the handler does not send or probe the unknown setting, so this is not evidence of an earlier boundary.\u003c/p\u003e\n\u003ch2\u003eRelated {#related}\u003c/h2\u003e\n\u003cp\u003e\u003ca href=\"/wiki/sqlstate/25P03/\" rel=\"nofollow\"\u003e25P03 idle-in-transaction timeout\u003c/a\u003e, \u003ca href=\"/wiki/sqlstate/40001/\" rel=\"nofollow\"\u003e40001 serialization failure\u003c/a\u003e, \u003ca href=\"/wiki/sqlstate/57014/\" rel=\"nofollow\"\u003e57014 query canceled\u003c/a\u003e.\u003c/p\u003e\n\u003ch2\u003eSources {#sources}\u003c/h2\u003e\n\u003cul\u003e\n\u003cli\u003e\u003ca href=\"https://github.com/postgres/postgres/blob/724edf9bde9d356724ad384a2e196edc3c9f80f7/src/backend/utils/errcodes.txt\" rel=\"nofollow\"\u003e\u003ccode\u003esrc.errcodes.18.6\u003c/code\u003e\u003c/a\u003e (SHA-256 \u003ccode\u003e6e8de346643ba84aa3c9c6a73360acfc7b2dfb89162c06c08ce9bf5bcd5bbcba\u003c/code\u003e)\u003c/li\u003e\n\u003cli\u003e\u003ccode\u003esrc.calls.REL_18_6\u003c/code\u003e — \u003ccode\u003eraw/calls/REL_18_6.jsonl\u003c/code\u003e (SHA-256 \u003ccode\u003e9ee8a0e81d8f0825c5c1ae45583439859a26e602bdd4ce2f2a62aa278867ccbf\u003c/code\u003e)\u003c/li\u003e\n\u003cli\u003e\u003ca href=\"https://github.com/postgres/postgres/blob/724edf9bde9d356724ad384a2e196edc3c9f80f7/src/backend/tcop/postgres.c#L3473-L3501\" rel=\"nofollow\"\u003e\u003ccode\u003esrc.postgres.18.6\u003c/code\u003e\u003c/a\u003e (SHA-256 \u003ccode\u003e9fb62275b1badf94d01ab351337b60410cd9b3ab1fe63fa9f23d6d2185a21061\u003c/code\u003e)\u003c/li\u003e\n\u003cli\u003e\u003ca href=\"https://github.com/postgres/postgres/blob/724edf9bde9d356724ad384a2e196edc3c9f80f7/doc/src/sgml/config.sgml#L10252-L10347\" rel=\"nofollow\"\u003e\u003ccode\u003esrc.config.18.6\u003c/code\u003e\u003c/a\u003e (SHA-256 \u003ccode\u003effca322c15315ba670733d6b320f23cbba7374db0d18937298ffc07b58799ef6\u003c/code\u003e) · \u003ca href=\"/docs/18/runtime-config-client.html\" rel=\"nofollow\"\u003eofficial documentation\u003c/a\u003e\u003c/li\u003e\n\u003cli\u003e\u003ca href=\"https://github.com/postgres/postgres/blob/724edf9bde9d356724ad384a2e196edc3c9f80f7/doc/src/sgml/monitoring.sgml#L706-L875\" rel=\"nofollow\"\u003e\u003ccode\u003edoc.monitoring.18.6\u003c/code\u003e\u003c/a\u003e (SHA-256 \u003ccode\u003e06b147f8d966fe46821871703ffcee8a3449cc3f7de5b64b9177f48569fe96f6\u003c/code\u003e) · \u003ca href=\"/docs/18/monitoring-stats.html\" rel=\"nofollow\"\u003eofficial monitoring documentation\u003c/a\u003e\u003c/li\u003e\n\u003cli\u003e\u003ca href=\"https://github.com/postgres/postgres/blob/724edf9bde9d356724ad384a2e196edc3c9f80f7/src/backend/catalog/system_views.sql#L604-L605\" rel=\"nofollow\"\u003e\u003ccode\u003esrc.system_views.18.6\u003c/code\u003e\u003c/a\u003e (SHA-256 \u003ccode\u003e418f4ae7472fe0742e6fbdc7a055581602c5131e082aa6f17e2c7269bf711972\u003c/code\u003e) · \u003ca href=\"/docs/18/view-pg-settings.html\" rel=\"nofollow\"\u003eofficial \u003ccode\u003epg_settings\u003c/code\u003e documentation\u003c/a\u003e\u003c/li\u003e\n\u003cli\u003e\u003ca href=\"https://github.com/postgres/postgres/blob/724edf9bde9d356724ad384a2e196edc3c9f80f7/doc/src/sgml/protocol.sgml#L61-L65\" rel=\"nofollow\"\u003e\u003ccode\u003edoc.protocol.18.6\u003c/code\u003e\u003c/a\u003e (SHA-256 \u003ccode\u003e745339e07ebbc2bb67d98b258e25772ada644ef26011e3cd6b3fcbb435235f89\u003c/code\u003e) · \u003ca href=\"/docs/18/protocol.html\" rel=\"nofollow\"\u003eofficial protocol documentation\u003c/a\u003e\u003c/li\u003e\n\u003c/ul\u003e\n","SourceRevision":"english-manuals:978606527e6134aa67f519a3abfcd9b4b446e0fe2ac90ab13a12c74630d5908f","ContentHash":"83784108832b42af0596cda5f6f438e94e1a5767c7a3f9692eda33eb445ab74f","Payload":{"body_md":"# 25P04 — transaction_timeout\n\n## At a glance {#at-a-glance}\n\n`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.\n\n\n## Meaning {#meaning}\n\n`transaction_timeout` limits the lifetime of an explicit or implicit transaction, including time spent executing or waiting while that transaction is open. When it fires, PostgreSQL emits `terminating connection due to transaction timeout` and terminates the session. It is different from `statement_timeout`, which aborts one statement, and from `idle_in_transaction_session_timeout`, which covers only client-idle time inside an open transaction. If `transaction_timeout` is shorter than or equal to either of those settings, the longer timeout is ignored; prepared transactions are not subject to it.\n\n## Diagnosis {#diagnosis}\n\nOn a supported server, capture the effective `SHOW transaction_timeout`, `SHOW statement_timeout`, and `SHOW idle_in_transaction_session_timeout` values on the timed session itself. A control connection's `SHOW` or `pg_settings` describes the observer backend and cannot establish another session's effective `SET` values. From the control connection inspect `pg_stat_activity` fields such as `pid`, `application_name`, `state`, `xact_start`, `state_change`, `query_start`, and `query` to identify the owning application or pool and whether the transaction is active or idle. Match the collector record by backend PID, SQLSTATE 25P04, `error_severity = FATAL`, and the exact message. In the selected 18.6 run the driver also exposed 25P04 and the original connection was closed; a fresh owner connection successfully ran `SELECT 1`. PG10 is skipped by the minimum-version preflight before `SET transaction_timeout` is sent.\n\n## Response {#response}\n\nDiscard the terminated session and reconnect. Keep legitimate transactions within the chosen budget by shortening work, splitting a long unit of work, or raising the effective timeout; do not lower it to hide the error. Set it to `0` only when the deployment deliberately accepts the absence of this guard. When the server closes the terminated session, it rolls back the open incomplete transaction before exiting; the dead connection cannot accept a later `ROLLBACK`. A known transaction that had not committed on that session cannot be recovered through that connection. If a separate network failure left it uncertain whether `COMMIT` reached the server, reconcile the business result from a fresh connection before retrying; the selected case sent no commit and does not establish that uncertainty. PG10 has no compatible setting in this batch.\n\n## FATAL message {#messages}\n\nThe server source emits `terminating connection due to transaction timeout` at `FATAL` severity; the original connection is terminated.\n\n## Observed diagnostics {#observed}\n\n`18.6 (Homebrew) / latest`: FATAL SQLSTATE `25P04`; primary `terminating connection due to transaction timeout`; backend PID `30576`; original connection closed `True`; collector CSV `25P04`; collector JSON `25P04`; fresh probe `1`.\n`10.21 (Debian 10.21-1.pgdg90+1) / pg10`: case `not_applicable` (minimum-version preflight; the unsupported setting was not probed).\n\nSeparate boundary comparison: `16.15 / pg16` returned `42704` for unavailable `transaction_timeout` and remained `IDLE`, so it is not 25P04 coverage. `17.11 / pg17` produced FATAL `25P04` after 300 ms with backend PID `73`; CSV and JSON both recorded FATAL `25P04`, the original connection closed, and a fresh connection was `IDLE`. These records are outside the selected base case.\n\n## Representative case {#case}\n\nThe SQL excerpt below is not a paste-all script: run the setting, PID, and `BEGIN` on a test connection, then stop sending it queries while a separate observer or log collector waits for FATAL; after the old connection is terminated, open a fresh owner connection for the final probe. The runner reads these statements from the shared registry; complete assertions, collector correlation, environment, and cleanup are in [case export](#cases).\n\n```sql\n-- set_timeout\nSET transaction_timeout = '300ms';\n-- backend_pid\nSELECT pg_backend_pid();\n-- begin\nBEGIN;\n-- probe\nSELECT 1;\n```\n\nThe SQLSTATE, diagnostics, states, and repair assertions for this excerpt come from the shared registry (SHA-256 `d05a26e56716c5c8c178f741843e6b14be87423ec9d1eb1a026ff67a57ce4658`); [structured evidence](#sources).\n\nAuthored evidence IDs: `identity`, `timeout-path`, `runtime`, `runtime.version-boundary`. Selected base runtime record: `runtime.25P04-batch2c-latest-20260909.latest`. Separate boundary records: `runtime.25P04-boundary-pg16-20260909.pg16` and `runtime.25P04-boundary-pg17-20260909.pg17`.\n\nThe separate boundary comparison has already recorded the availability check: PG16 returned `42704` and PG17 continued to a natural FATAL `25P04`. This boundary block is branched, not a paste-all script. On PG16, run `SHOW transaction_timeout`; after the expected `42704`, use the same still-healthy connection for `SELECT 1` if you need to prove recovery, then stop and skip `SET transaction_timeout`, `BEGIN`, and the timeout wait. On PG17 or later, after `SHOW` succeeds, run `SET transaction_timeout`, capture the PID, and run `BEGIN`; then stop sending queries and let the observer or collector wait for the old connection's FATAL and closure. Open a fresh connection only for the final probe. The boundary records are diagnostic comparisons and do not add to the selected base case count.\n\n```sql\n-- availability_probe\nSHOW transaction_timeout;\n-- set_timeout\nSET transaction_timeout = '300ms';\n-- backend_pid\nSELECT pg_backend_pid();\n-- begin\nBEGIN;\n-- probe\nSELECT 1;\n```\n\n## Versions and limits {#versions}\n\nThe locked catalogue first observes `transaction_timeout` in 17.0. The selected 18.6 case passes with CSV/JSON collector evidence and a fresh-connection probe. The separate PG17.11 boundary case independently records natural FATAL `25P04`, while PG16.15 records unavailable-setting `42704`; neither replaces the selected base run. The PG10 case is a real `not_applicable` minimum-version preflight skip: the handler does not send or probe the unknown setting, so this is not evidence of an earlier boundary.\n\n## Related {#related}\n\n[25P03 idle-in-transaction timeout](/wiki/sqlstate/25P03/), [40001 serialization failure](/wiki/sqlstate/40001/), [57014 query canceled](/wiki/sqlstate/57014/).\n\n## Sources {#sources}\n\n- [`src.errcodes.18.6`](https://github.com/postgres/postgres/blob/724edf9bde9d356724ad384a2e196edc3c9f80f7/src/backend/utils/errcodes.txt) (SHA-256 `6e8de346643ba84aa3c9c6a73360acfc7b2dfb89162c06c08ce9bf5bcd5bbcba`)\n- `src.calls.REL_18_6` — `raw/calls/REL_18_6.jsonl` (SHA-256 `9ee8a0e81d8f0825c5c1ae45583439859a26e602bdd4ce2f2a62aa278867ccbf`)\n- [`src.postgres.18.6`](https://github.com/postgres/postgres/blob/724edf9bde9d356724ad384a2e196edc3c9f80f7/src/backend/tcop/postgres.c#L3473-L3501) (SHA-256 `9fb62275b1badf94d01ab351337b60410cd9b3ab1fe63fa9f23d6d2185a21061`)\n- [`src.config.18.6`](https://github.com/postgres/postgres/blob/724edf9bde9d356724ad384a2e196edc3c9f80f7/doc/src/sgml/config.sgml#L10252-L10347) (SHA-256 `ffca322c15315ba670733d6b320f23cbba7374db0d18937298ffc07b58799ef6`) · [official documentation](/docs/18/runtime-config-client.html)\n- [`doc.monitoring.18.6`](https://github.com/postgres/postgres/blob/724edf9bde9d356724ad384a2e196edc3c9f80f7/doc/src/sgml/monitoring.sgml#L706-L875) (SHA-256 `06b147f8d966fe46821871703ffcee8a3449cc3f7de5b64b9177f48569fe96f6`) · [official monitoring documentation](/docs/18/monitoring-stats.html)\n- [`src.system_views.18.6`](https://github.com/postgres/postgres/blob/724edf9bde9d356724ad384a2e196edc3c9f80f7/src/backend/catalog/system_views.sql#L604-L605) (SHA-256 `418f4ae7472fe0742e6fbdc7a055581602c5131e082aa6f17e2c7269bf711972`) · [official `pg_settings` documentation](/docs/18/view-pg-settings.html)\n- [`doc.protocol.18.6`](https://github.com/postgres/postgres/blob/724edf9bde9d356724ad384a2e196edc3c9f80f7/doc/src/sgml/protocol.sgml#L61-L65) (SHA-256 `745339e07ebbc2bb67d98b258e25772ada644ef26011e3cd6b3fcbb435235f89`) · [official protocol documentation](/docs/18/protocol.html)\n","description":"PostgreSQL SQLSTATE 25P04: session termination when an explicit or implicit transaction exceeds transaction_timeout.","is_stale":false,"name":"","sections":[{"anchor":"","heading":"","html":"\u0026lt;h1\u0026gt;25P04 — transaction_timeout\u0026lt;/h1\u0026gt;"},{"anchor":"at-a-glance","heading":"At a glance","html":"\u003cp\u003e\u003ccode\u003e25P04\u003c/code\u003e is a FATAL condition emitted by \u003ccode\u003etransaction_timeout\u003c/code\u003e, which covers both an explicit \u003ccode\u003eBEGIN\u003c/code\u003e 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 \u003ccode\u003e42704\u003c/code\u003e on PG16 and natural FATAL \u003ccode\u003e25P04\u003c/code\u003e on PG17; it is separate from the selected base case.\u003c/p\u003e"},{"anchor":"meaning","heading":"Meaning","html":"\u003cp\u003e\u003ccode\u003etransaction_timeout\u003c/code\u003e limits the lifetime of an explicit or implicit transaction, including time spent executing or waiting while that transaction is open. When it fires, PostgreSQL emits \u003ccode\u003eterminating connection due to transaction timeout\u003c/code\u003e and terminates the session. It is different from \u003ccode\u003estatement_timeout\u003c/code\u003e, which aborts one statement, and from \u003ccode\u003eidle_in_transaction_session_timeout\u003c/code\u003e, which covers only client-idle time inside an open transaction. If \u003ccode\u003etransaction_timeout\u003c/code\u003e is shorter than or equal to either of those settings, the longer timeout is ignored; prepared transactions are not subject to it.\u003c/p\u003e"},{"anchor":"diagnosis","heading":"Diagnosis","html":"\u003cp\u003eOn a supported server, capture the effective \u003ccode\u003eSHOW transaction_timeout\u003c/code\u003e, \u003ccode\u003eSHOW statement_timeout\u003c/code\u003e, and \u003ccode\u003eSHOW idle_in_transaction_session_timeout\u003c/code\u003e values on the timed session itself. A control connection's \u003ccode\u003eSHOW\u003c/code\u003e or \u003ccode\u003epg_settings\u003c/code\u003e describes the observer backend and cannot establish another session's effective \u003ccode\u003eSET\u003c/code\u003e values. From the control connection inspect \u003ccode\u003epg_stat_activity\u003c/code\u003e fields such as \u003ccode\u003epid\u003c/code\u003e, \u003ccode\u003eapplication_name\u003c/code\u003e, \u003ccode\u003estate\u003c/code\u003e, \u003ccode\u003exact_start\u003c/code\u003e, \u003ccode\u003estate_change\u003c/code\u003e, \u003ccode\u003equery_start\u003c/code\u003e, and \u003ccode\u003equery\u003c/code\u003e to identify the owning application or pool and whether the transaction is active or idle. Match the collector record by backend PID, SQLSTATE 25P04, \u003ccode\u003eerror_severity = FATAL\u003c/code\u003e, and the exact message. In the selected 18.6 run the driver also exposed 25P04 and the original connection was closed; a fresh owner connection successfully ran \u003ccode\u003eSELECT 1\u003c/code\u003e. PG10 is skipped by the minimum-version preflight before \u003ccode\u003eSET transaction_timeout\u003c/code\u003e is sent.\u003c/p\u003e"},{"anchor":"response","heading":"Response","html":"\u003cp\u003eDiscard the terminated session and reconnect. Keep legitimate transactions within the chosen budget by shortening work, splitting a long unit of work, or raising the effective timeout; do not lower it to hide the error. Set it to \u003ccode\u003e0\u003c/code\u003e only when the deployment deliberately accepts the absence of this guard. When the server closes the terminated session, it rolls back the open incomplete transaction before exiting; the dead connection cannot accept a later \u003ccode\u003eROLLBACK\u003c/code\u003e. A known transaction that had not committed on that session cannot be recovered through that connection. If a separate network failure left it uncertain whether \u003ccode\u003eCOMMIT\u003c/code\u003e reached the server, reconcile the business result from a fresh connection before retrying; the selected case sent no commit and does not establish that uncertainty. PG10 has no compatible setting in this batch.\u003c/p\u003e"},{"anchor":"messages","heading":"FATAL message","html":"\u003cp\u003eThe server source emits \u003ccode\u003eterminating connection due to transaction timeout\u003c/code\u003e at \u003ccode\u003eFATAL\u003c/code\u003e severity; the original connection is terminated.\u003c/p\u003e"},{"anchor":"observed","heading":"Observed diagnostics","html":"\u003cp\u003e\u003ccode\u003e18.6 (Homebrew) / latest\u003c/code\u003e: FATAL SQLSTATE \u003ccode\u003e25P04\u003c/code\u003e; primary \u003ccode\u003eterminating connection due to transaction timeout\u003c/code\u003e; backend PID \u003ccode\u003e30576\u003c/code\u003e; original connection closed \u003ccode\u003eTrue\u003c/code\u003e; collector CSV \u003ccode\u003e25P04\u003c/code\u003e; collector JSON \u003ccode\u003e25P04\u003c/code\u003e; fresh probe \u003ccode\u003e1\u003c/code\u003e.\n\u003ccode\u003e10.21 (Debian 10.21-1.pgdg90+1) / pg10\u003c/code\u003e: case \u003ccode\u003enot_applicable\u003c/code\u003e (minimum-version preflight; the unsupported setting was not probed).\u003c/p\u003e\n\u003cp\u003eSeparate boundary comparison: \u003ccode\u003e16.15 / pg16\u003c/code\u003e returned \u003ccode\u003e42704\u003c/code\u003e for unavailable \u003ccode\u003etransaction_timeout\u003c/code\u003e and remained \u003ccode\u003eIDLE\u003c/code\u003e, so it is not 25P04 coverage. \u003ccode\u003e17.11 / pg17\u003c/code\u003e produced FATAL \u003ccode\u003e25P04\u003c/code\u003e after 300 ms with backend PID \u003ccode\u003e73\u003c/code\u003e; CSV and JSON both recorded FATAL \u003ccode\u003e25P04\u003c/code\u003e, the original connection closed, and a fresh connection was \u003ccode\u003eIDLE\u003c/code\u003e. These records are outside the selected base case.\u003c/p\u003e"},{"anchor":"case","heading":"Representative case","html":"\u003cp\u003eThe SQL excerpt below is not a paste-all script: run the setting, PID, and \u003ccode\u003eBEGIN\u003c/code\u003e on a test connection, then stop sending it queries while a separate observer or log collector waits for FATAL; after the old connection is terminated, open a fresh owner connection for the final probe. The runner reads these statements from the shared registry; complete assertions, collector correlation, environment, and cleanup are in \u003ca href=\"#cases\"\u003ecase export\u003c/a\u003e.\u003c/p\u003e\n\u003cpre\u003e\u003ccode class=\"language-sql\"\u003e-- set_timeout\nSET transaction_timeout = '300ms';\n-- backend_pid\nSELECT pg_backend_pid();\n-- begin\nBEGIN;\n-- probe\nSELECT 1;\n\u003c/code\u003e\u003c/pre\u003e\n\u003cp\u003eThe SQLSTATE, diagnostics, states, and repair assertions for this excerpt come from the shared registry (SHA-256 \u003ccode\u003ed05a26e56716c5c8c178f741843e6b14be87423ec9d1eb1a026ff67a57ce4658\u003c/code\u003e); \u003ca href=\"#sources\"\u003estructured evidence\u003c/a\u003e.\u003c/p\u003e\n\u003cp\u003eAuthored evidence IDs: \u003ccode\u003eidentity\u003c/code\u003e, \u003ccode\u003etimeout-path\u003c/code\u003e, \u003ccode\u003eruntime\u003c/code\u003e, \u003ccode\u003eruntime.version-boundary\u003c/code\u003e. Selected base runtime record: \u003ccode\u003eruntime.25P04-batch2c-latest-20260909.latest\u003c/code\u003e. Separate boundary records: \u003ccode\u003eruntime.25P04-boundary-pg16-20260909.pg16\u003c/code\u003e and \u003ccode\u003eruntime.25P04-boundary-pg17-20260909.pg17\u003c/code\u003e.\u003c/p\u003e\n\u003cp\u003eThe separate boundary comparison has already recorded the availability check: PG16 returned \u003ccode\u003e42704\u003c/code\u003e and PG17 continued to a natural FATAL \u003ccode\u003e25P04\u003c/code\u003e. This boundary block is branched, not a paste-all script. On PG16, run \u003ccode\u003eSHOW transaction_timeout\u003c/code\u003e; after the expected \u003ccode\u003e42704\u003c/code\u003e, use the same still-healthy connection for \u003ccode\u003eSELECT 1\u003c/code\u003e if you need to prove recovery, then stop and skip \u003ccode\u003eSET transaction_timeout\u003c/code\u003e, \u003ccode\u003eBEGIN\u003c/code\u003e, and the timeout wait. On PG17 or later, after \u003ccode\u003eSHOW\u003c/code\u003e succeeds, run \u003ccode\u003eSET transaction_timeout\u003c/code\u003e, capture the PID, and run \u003ccode\u003eBEGIN\u003c/code\u003e; then stop sending queries and let the observer or collector wait for the old connection's FATAL and closure. Open a fresh connection only for the final probe. The boundary records are diagnostic comparisons and do not add to the selected base case count.\u003c/p\u003e\n\u003cpre\u003e\u003ccode class=\"language-sql\"\u003e-- availability_probe\nSHOW transaction_timeout;\n-- set_timeout\nSET transaction_timeout = '300ms';\n-- backend_pid\nSELECT pg_backend_pid();\n-- begin\nBEGIN;\n-- probe\nSELECT 1;\n\u003c/code\u003e\u003c/pre\u003e"},{"anchor":"versions","heading":"Versions and limits","html":"\u003cp\u003eThe locked catalogue first observes \u003ccode\u003etransaction_timeout\u003c/code\u003e in 17.0. The selected 18.6 case passes with CSV/JSON collector evidence and a fresh-connection probe. The separate PG17.11 boundary case independently records natural FATAL \u003ccode\u003e25P04\u003c/code\u003e, while PG16.15 records unavailable-setting \u003ccode\u003e42704\u003c/code\u003e; neither replaces the selected base run. The PG10 case is a real \u003ccode\u003enot_applicable\u003c/code\u003e minimum-version preflight skip: the handler does not send or probe the unknown setting, so this is not evidence of an earlier boundary.\u003c/p\u003e"},{"anchor":"related","heading":"Related","html":"\u003cp\u003e\u003ca href=\"/wiki/sqlstate/25P03/\"\u003e25P03 idle-in-transaction timeout\u003c/a\u003e, \u003ca href=\"/wiki/sqlstate/40001/\"\u003e40001 serialization failure\u003c/a\u003e, \u003ca href=\"/wiki/sqlstate/57014/\"\u003e57014 query canceled\u003c/a\u003e.\u003c/p\u003e"},{"anchor":"sources","heading":"Sources","html":"\u003cul\u003e\n\u003cli\u003e\u003ca href=\"https://github.com/postgres/postgres/blob/724edf9bde9d356724ad384a2e196edc3c9f80f7/src/backend/utils/errcodes.txt\"\u003e\u003ccode\u003esrc.errcodes.18.6\u003c/code\u003e\u003c/a\u003e (SHA-256 \u003ccode\u003e6e8de346643ba84aa3c9c6a73360acfc7b2dfb89162c06c08ce9bf5bcd5bbcba\u003c/code\u003e)\u003c/li\u003e\n\u003cli\u003e\u003ccode\u003esrc.calls.REL_18_6\u003c/code\u003e — \u003ccode\u003eraw/calls/REL_18_6.jsonl\u003c/code\u003e (SHA-256 \u003ccode\u003e9ee8a0e81d8f0825c5c1ae45583439859a26e602bdd4ce2f2a62aa278867ccbf\u003c/code\u003e)\u003c/li\u003e\n\u003cli\u003e\u003ca href=\"https://github.com/postgres/postgres/blob/724edf9bde9d356724ad384a2e196edc3c9f80f7/src/backend/tcop/postgres.c#L3473-L3501\"\u003e\u003ccode\u003esrc.postgres.18.6\u003c/code\u003e\u003c/a\u003e (SHA-256 \u003ccode\u003e9fb62275b1badf94d01ab351337b60410cd9b3ab1fe63fa9f23d6d2185a21061\u003c/code\u003e)\u003c/li\u003e\n\u003cli\u003e\u003ca href=\"https://github.com/postgres/postgres/blob/724edf9bde9d356724ad384a2e196edc3c9f80f7/doc/src/sgml/config.sgml#L10252-L10347\"\u003e\u003ccode\u003esrc.config.18.6\u003c/code\u003e\u003c/a\u003e (SHA-256 \u003ccode\u003effca322c15315ba670733d6b320f23cbba7374db0d18937298ffc07b58799ef6\u003c/code\u003e) · \u003ca href=\"/docs/18/runtime-config-client.html\"\u003eofficial documentation\u003c/a\u003e\u003c/li\u003e\n\u003cli\u003e\u003ca href=\"https://github.com/postgres/postgres/blob/724edf9bde9d356724ad384a2e196edc3c9f80f7/doc/src/sgml/monitoring.sgml#L706-L875\"\u003e\u003ccode\u003edoc.monitoring.18.6\u003c/code\u003e\u003c/a\u003e (SHA-256 \u003ccode\u003e06b147f8d966fe46821871703ffcee8a3449cc3f7de5b64b9177f48569fe96f6\u003c/code\u003e) · \u003ca href=\"/docs/18/monitoring-stats.html\"\u003eofficial monitoring documentation\u003c/a\u003e\u003c/li\u003e\n\u003cli\u003e\u003ca href=\"https://github.com/postgres/postgres/blob/724edf9bde9d356724ad384a2e196edc3c9f80f7/src/backend/catalog/system_views.sql#L604-L605\"\u003e\u003ccode\u003esrc.system_views.18.6\u003c/code\u003e\u003c/a\u003e (SHA-256 \u003ccode\u003e418f4ae7472fe0742e6fbdc7a055581602c5131e082aa6f17e2c7269bf711972\u003c/code\u003e) · \u003ca href=\"/docs/18/view-pg-settings.html\"\u003eofficial \u003ccode\u003epg_settings\u003c/code\u003e documentation\u003c/a\u003e\u003c/li\u003e\n\u003cli\u003e\u003ca href=\"https://github.com/postgres/postgres/blob/724edf9bde9d356724ad384a2e196edc3c9f80f7/doc/src/sgml/protocol.sgml#L61-L65\"\u003e\u003ccode\u003edoc.protocol.18.6\u003c/code\u003e\u003c/a\u003e (SHA-256 \u003ccode\u003e745339e07ebbc2bb67d98b258e25772ada644ef26011e3cd6b3fcbb435235f89\u003c/code\u003e) · \u003ca href=\"/docs/18/protocol.html\"\u003eofficial protocol documentation\u003c/a\u003e\u003c/li\u003e\n\u003c/ul\u003e"}],"summary":"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.","title":"25P04 — transaction_timeout","translation_source_rev":"049f333bc37c02c37a782fdd88275bfb3ad73fd5449a35c81db7dee5b4565fe3"}},"RequestedLocale":"en","Fallback":false,"Versions":["17","18","19","20"],"Locales":["en","zh-Hans"],"Signatures":null,"Spellings":null,"SQLState":{"aliases":[],"catalogue_notes":{"earliest_observed":"17.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":"25","class_name":"Invalid Transaction State","condition_name":"transaction_timeout","condition_names":["transaction_timeout"],"definition_changes":[],"english_manuals":{"17":{"aliases":[],"class_name":"Invalid Transaction State","condition_name":"transaction_timeout","doc":{"anchor":"ERRCODES-APPENDIX","file":"errcodes-appendix.html","lang":"en","sha256":"868135520af87351e3ea1ba42656111cbd2d157d98e1fef05ea158ac5729d8b1","slug":"17"},"lang":"en","sqlstate":"25P04"},"18":{"aliases":[],"class_name":"Invalid Transaction State","condition_name":"transaction_timeout","doc":{"anchor":"ERRCODES-APPENDIX","file":"errcodes-appendix.html","lang":"en","sha256":"56dacf78e618ff0fd8c533e05db597b80d7ebbad7f8e512a888217d0640aa328","slug":"18"},"lang":"en","sqlstate":"25P04"},"19":{"aliases":[],"class_name":"Invalid Transaction State","condition_name":"transaction_timeout","doc":{"anchor":"ERRCODES-APPENDIX","file":"errcodes-appendix.html","lang":"en","sha256":"63fb8d1aa9f494eeab9d0f8542a2b673f7746ee41ae2689d19403cb3cc425a5c","slug":"19"},"lang":"en","sqlstate":"25P04"},"20":{"aliases":[],"class_name":"Invalid Transaction State","condition_name":"transaction_timeout","doc":{"anchor":"ERRCODES-APPENDIX","file":"errcodes-appendix.html","lang":"en","sha256":"0d3f602127cd137cf343b32d5fa78f175eeb6cdcb6353b1f6f998ede6cb7b911","slug":"devel"},"lang":"en","sqlstate":"25P04"}},"history_boundary":{"earliest_observed":"17.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":"17.0","macros":["ERRCODE_TRANSACTION_TIMEOUT"],"manual_presence":["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":"17.11","end_major":"17","end_tag":"REL_17_11","evidence_count":12,"position":0,"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":1,"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":2,"start":"18.6","start_major":"18","start_tag":"REL_18_6"}],"present_in_snapshots":["17.11","18.6","19beta3"],"preview_in_snapshots":["19beta3"],"primary_macro":"ERRCODE_TRANSACTION_TIMEOUT","removed":null,"schema_version":2,"severity_classes":["E"],"sources":[{"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":"25P04","status":"active","usage_evidence":[{"evidence_ids":["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":"transaction_timeout","ServerVersion":null,"Status":null,"Payload":{"assertions":["The original session is terminated by the timeout when supported","The collector records FATAL 25P04 for the matching backend PID","A fresh connection can execute SELECT 1","PG10 is explicitly not applicable"],"case_id":"transaction_timeout","cleanup":"Drop the case schema with an owner connection.","has_snippet":true,"position":0,"preconditions":["A runner-owned disposable target is provisioned."],"repair":"Use the state-specific recovery documented on the page; do not reuse a terminated connection.","trigger":"On a server supporting transaction_timeout, set it, BEGIN, wait, and probe the terminated session.","versions":["18"]}},{"Kind":"cases","Ordinal":1,"ID":"transaction_timeout_version_boundary","ServerVersion":null,"Status":null,"Payload":{"assertions":["PG16 records the actual unsupported-setting diagnostic and recovers","PG17 records exact FATAL 25P04 collector fields and a registry-based fresh connection probe"],"case_id":"transaction_timeout_version_boundary","cleanup":"Drop the case schema with an owner connection.","has_snippet":true,"position":1,"preconditions":["A disposable PostgreSQL 16 or 17 target"],"repair":"Treat PG16 as unsupported for this setting; for PG17 use a fresh connection after the FATAL and determine unfinished work from the application transaction boundary.","trigger":"Probe transaction_timeout on PG16; on PG17 set it, BEGIN, wait, and probe the terminated session.","versions":["16","17"]}},{"Kind":"claims","Ordinal":0,"ID":"identity","ServerVersion":null,"Status":null,"Payload":{"claim_id":"identity","limits":"The locked catalogue first observes this condition in PostgreSQL 17.0; no earlier runtime claim is made.","method":"Read the fixed condition row and macro.","position":0,"runtime":[],"sources":["src.errcodes.18.6"],"statement":"25P04 is transaction_timeout in Class 25."}},{"Kind":"claims","Ordinal":1,"ID":"timeout-path","ServerVersion":null,"Status":null,"Payload":{"claim_id":"timeout-path","limits":"The selected PG10 target lacks this setting and is explicitly not applicable; the session is terminated when the path fires.","method":"Trace the timeout interrupt and the fixed configuration documentation.","position":1,"runtime":[],"sources":["src.postgres.18.6","src.config.18.6","src.calls.REL_18_6"],"statement":"ProcessInterrupts emits FATAL 25P04 when an explicit or implicitly started transaction exceeds transaction_timeout."}},{"Kind":"claims","Ordinal":2,"ID":"runtime","ServerVersion":null,"Status":null,"Payload":{"claim_id":"runtime","limits":"This verifies 18.6 and the PG10 applicability boundary only; it does not claim all intermediate releases without an adjacent source check.","method":"Match collector records by PID, SQLSTATE, and message, then probe a fresh connection.","position":2,"runtime":[],"sources":["runtime","runtime.25P04-batch2c-latest-20260909.latest","runtime.25P04-batch2c-pg10-20260909.pg10"],"statement":"The selected PostgreSQL 18.6 case received FATAL 25P04 for the exact backend PID and recovered only by opening a fresh connection; the PG10 case is not applicable."}},{"Kind":"claims","Ordinal":3,"ID":"diagnosis-observer-boundary","ServerVersion":null,"Status":null,"Payload":{"claim_id":"diagnosis-observer-boundary","limits":"Visibility of pg_stat_activity fields depends on observer privileges; the selected runtime records establish PID/log correlation, not universal monitoring permissions.","method":"Read the fixed monitoring view documentation and system-view definition before writing the observer/session diagnostic split.","position":3,"runtime":[],"sources":["doc.monitoring.18.6","src.system_views.18.6"],"statement":"The fixed monitoring documentation defines pg_stat_activity as one row per server process with current activity, including xact_start and state_change; pg_settings is defined over pg_show_all_settings for the current backend. Capture timeout settings on the timed session itself, because SHOW or pg_settings on an observer connection cannot establish another backend's effective SET value."}},{"Kind":"claims","Ordinal":4,"ID":"termination-rollback","ServerVersion":null,"Status":null,"Payload":{"claim_id":"termination-rollback","limits":"This establishes server-side rollback on forced connection close; it does not resolve a separate network failure after a client may have sent COMMIT.","method":"Read the fixed protocol session-termination rule and align the recovery prose with the FATAL path.","position":4,"runtime":[],"sources":["doc.protocol.18.6"],"statement":"The fixed protocol documentation states that when the backend closes a connection it rolls back any open incomplete transaction before exiting; the driver cannot send a later ROLLBACK on that closed session."}},{"Kind":"claims","Ordinal":5,"ID":"runtime.version-boundary","ServerVersion":null,"Status":null,"Payload":{"claim_id":"runtime.version-boundary","limits":"This is a bounded PG16.15/PG17.11 comparison for transaction_timeout. PG16 42704 is not 25P04 coverage; the records do not replace the selected 18.6 run or establish every intermediate minor release.","method":"Compare the fixed PG16 availability probe and PG17 timeout summaries, including driver diagnostics, both collector severities, PID correlation, termination, and fresh-connection recovery.","position":5,"runtime":[],"sources":["src.config.18.6","doc.protocol.18.6","runtime.25P04-boundary-pg16-20260909.pg16","runtime.25P04-boundary-pg17-20260909.pg17"],"statement":"On the fixed availability-boundary registry case, PostgreSQL 16.15 rejects SHOW transaction_timeout with 42704 and remains IDLE, while PostgreSQL 17.11 receives FATAL 25P04 after a 300 ms timeout in an idle-in-transaction session; the original session closes and a fresh connection is IDLE."}},{"Kind":"messages","Ordinal":0,"ID":"fatal","ServerVersion":null,"Status":null,"Payload":{"limits":"This is a static FATAL message; the driver may expose or omit SQLSTATE depending on client stack.","message_id":"fatal","path":"","position":0,"raw":{"id":"fatal","limits":"This is a static FATAL message; the driver may expose or omit SQLSTATE depending on client stack.","primary_template":"terminating connection due to transaction timeout","severity_source":"FATAL","sources":["src.postgres.18.6"],"sqlstate":"25P04"},"severity":"FATAL","sources":["src.postgres.18.6"],"templates":[{"kind":"primary","literal":"terminating connection due to transaction timeout","position":0,"role":"","template":"terminating connection due to transaction timeout"}]}},{"Kind":"runtimes","Ordinal":0,"ID":"runtime.25P04-batch2c-latest-20260909.latest","ServerVersion":"18.6 (Homebrew)","Status":"passed","Payload":{"cases":["transaction_timeout"],"limits":"","position":0,"raw":{"case_manifest":{"path":"verify/cases/25P04/cases.json","sha256":"7ec049ed04b847e80c6770278f3dca1b3ef5357d27bada2a2f3e1a98e955e950"},"case_status":"passed","cases":["transaction_timeout"],"id":"runtime.25P04-batch2c-latest-20260909.latest","observed":{"backend_pid":30576,"collector_csv_error_severity":"FATAL","collector_csv_sqlstate":"25P04","collector_json_error_severity":"FATAL","collector_json_sqlstate":"25P04","fresh_connection_probe":1,"fresh_connection_status":"IDLE","original_connection_closed":true,"primary":"terminating connection due to transaction timeout","recovery_requires_new_connection":true,"severity":"FATAL","sqlstate":"25P04","status_before_timeout":"INTRANS"},"raw":"verify/results/25P04-batch2c-latest-20260909/latest/raw.jsonl","raw_sha256":"604f0195a1736b0e1cc25d5dc27daaa39647ecaf6dd4815284abe34c98cc3c1e","run_id":"25P04-batch2c-latest-20260909","server_version":"18.6 (Homebrew)","server_version_num":180006,"snippet_registry":{"path":"verify/cases/25P04/snippets.json","sha256":"d05a26e56716c5c8c178f741843e6b14be87423ec9d1eb1a026ff67a57ce4658"},"status":"passed","summary":"verify/results/25P04-batch2c-latest-20260909/latest/summary.json","summary_sha256":"a01d53576c6c15395d88f85039e10d792fbfc72042fd355c14aea06e779fc20f","target":"latest","target_status":"passed"},"run_id":"25P04-batch2c-latest-20260909","runtime_id":"runtime.25P04-batch2c-latest-20260909.latest","server_version":"18.6 (Homebrew)","status":"passed","target":"latest"}},{"Kind":"runtimes","Ordinal":1,"ID":"runtime.25P04-batch2c-pg10-20260909.pg10","ServerVersion":"10.21 (Debian 10.21-1.pgdg90+1)","Status":"not_applicable","Payload":{"cases":["transaction_timeout"],"limits":"","position":1,"raw":{"case_manifest":{"path":"verify/cases/25P04/cases.json","sha256":"7ec049ed04b847e80c6770278f3dca1b3ef5357d27bada2a2f3e1a98e955e950"},"case_status":"not_applicable","cases":["transaction_timeout"],"id":"runtime.25P04-batch2c-pg10-20260909.pg10","observed":{"case_status":"not_applicable","minimum_version":170000,"preflight":"minimum_version","server_version_num":100021,"setting":"transaction_timeout","setting_probe_skipped":true},"raw":"verify/results/25P04-batch2c-pg10-20260909/pg10/raw.jsonl","raw_sha256":"30249f5670f41a2381d3934a9ab40c9e4317e5831c5d3a1941e0a725d5454260","run_id":"25P04-batch2c-pg10-20260909","server_version":"10.21 (Debian 10.21-1.pgdg90+1)","server_version_num":100021,"snippet_registry":{"path":"verify/cases/25P04/snippets.json","sha256":"d05a26e56716c5c8c178f741843e6b14be87423ec9d1eb1a026ff67a57ce4658"},"status":"not_applicable","summary":"verify/results/25P04-batch2c-pg10-20260909/pg10/summary.json","summary_sha256":"2031245d82e9963d70c7f1b969ebf7a3fc5fd308c646501e9e158a6723dafc05","target":"pg10","target_status":"passed"},"run_id":"25P04-batch2c-pg10-20260909","runtime_id":"runtime.25P04-batch2c-pg10-20260909.pg10","server_version":"10.21 (Debian 10.21-1.pgdg90+1)","status":"not_applicable","target":"pg10"}},{"Kind":"runtimes","Ordinal":2,"ID":"runtime.25P04-boundary-pg16-20260909.pg16","ServerVersion":"16.15 (Debian 16.15-1.pgdg13+2)","Status":"not_applicable","Payload":{"cases":["transaction_timeout_version_boundary"],"limits":"The case passed its availability assertions, but this target does not have the setting. The 42704 probe is retained as a version comparison and is not counted as a 25P04 runtime.","position":2,"raw":{"case_manifest":{"path":"verify/cases/25P04/cases.json","sha256":"84064c260277d4051404d55d1e912d6f6ebafcea2ef681382cf854a0e79ec7ed"},"case_status":"passed","cases":["transaction_timeout_version_boundary"],"id":"runtime.25P04-boundary-pg16-20260909.pg16","limits":"The case passed its availability assertions, but this target does not have the setting. The 42704 probe is retained as a version comparison and is not counted as a 25P04 runtime.","observed":{"availability_primary":"unrecognized configuration parameter \"transaction_timeout\"","availability_severity":"ERROR","availability_sqlstate":"42704","fresh_connection_probe":1,"natural_25P04_observed":false,"setting":"transaction_timeout","status_after_probe":"IDLE"},"raw":"verify/results/25P04-boundary-pg16-20260909/pg16/raw.jsonl","raw_sha256":"80fbaa2148e40c6c9239c68a44d4659f485e18aa8dfcdf4451a2496a609a4ff0","run_id":"25P04-boundary-pg16-20260909","selection_status":"selected_boundary_comparison","server_version":"16.15 (Debian 16.15-1.pgdg13+2)","server_version_num":160015,"snippet_registry":{"path":"verify/cases/25P04/snippets.json","sha256":"b25b99aa679f058e02229dd8d4ecd1ae4af41d11b19f80199f013da118ef3112"},"status":"not_applicable","summary":"verify/results/25P04-boundary-pg16-20260909/pg16/summary.json","summary_sha256":"96faef46bcf544732c797ef975add02a6b06684821a4df7e99448aa2355e08d1","target":"pg16","target_status":"passed"},"run_id":"25P04-boundary-pg16-20260909","runtime_id":"runtime.25P04-boundary-pg16-20260909.pg16","server_version":"16.15 (Debian 16.15-1.pgdg13+2)","status":"not_applicable","target":"pg16"}},{"Kind":"runtimes","Ordinal":3,"ID":"runtime.25P04-boundary-pg17-20260909.pg17","ServerVersion":"17.11 (Debian 17.11-1.pgdg13+2)","Status":"passed","Payload":{"cases":["transaction_timeout_version_boundary"],"limits":"This separate PG17.11 boundary case demonstrates the natural FATAL path and fresh-session recovery; it does not replace or inflate the selected base 18.6 case.","position":3,"raw":{"case_manifest":{"path":"verify/cases/25P04/cases.json","sha256":"84064c260277d4051404d55d1e912d6f6ebafcea2ef681382cf854a0e79ec7ed"},"case_status":"passed","cases":["transaction_timeout_version_boundary"],"id":"runtime.25P04-boundary-pg17-20260909.pg17","limits":"This separate PG17.11 boundary case demonstrates the natural FATAL path and fresh-session recovery; it does not replace or inflate the selected base 18.6 case.","observed":{"backend_pid":73,"collector_csv_severity":"FATAL","collector_csv_sqlstate":"25P04","collector_json_severity":"FATAL","collector_json_sqlstate":"25P04","driver_severity":"FATAL","fresh_connection_probe":1,"fresh_connection_status":"IDLE","natural_25P04_observed":true,"original_connection_closed":true,"primary":"terminating connection due to transaction timeout","setting":"transaction_timeout","sqlstate":"25P04","status_before_timeout":"INTRANS","timeout_ms":300},"raw":"verify/results/25P04-boundary-pg17-20260909/pg17/raw.jsonl","raw_sha256":"61e5e0ff62adc6d1744c61a36167ca6e4f754ebbefd905ab1002bf10c2e4cb8f","run_id":"25P04-boundary-pg17-20260909","selection_status":"selected_boundary_comparison","server_version":"17.11 (Debian 17.11-1.pgdg13+2)","server_version_num":170011,"snippet_registry":{"path":"verify/cases/25P04/snippets.json","sha256":"b25b99aa679f058e02229dd8d4ecd1ae4af41d11b19f80199f013da118ef3112"},"status":"passed","summary":"verify/results/25P04-boundary-pg17-20260909/pg17/summary.json","summary_sha256":"3342eea9eb7a3ed2dc24f56a321bd648444e074f45f08ec5bc9adc3b2c2dd1f7","target":"pg17","target_status":"passed"},"run_id":"25P04-boundary-pg17-20260909","runtime_id":"runtime.25P04-boundary-pg17-20260909.pg17","server_version":"17.11 (Debian 17.11-1.pgdg13+2)","status":"passed","target":"pg17"}},{"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"}},{"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.postgres.18.6","ServerVersion":null,"Status":null,"Payload":{"commit":"724edf9bde9d356724ad384a2e196edc3c9f80f7","docs_url":"","kind":"upstream_source","location":"","path":"src/backend/tcop/postgres.c","position":2,"sha256":"9fb62275b1badf94d01ab351337b60410cd9b3ab1fe63fa9f23d6d2185a21061","source_id":"src.postgres.18.6","tag":"REL_18_6","url":"https://github.com/postgres/postgres/blob/724edf9bde9d356724ad384a2e196edc3c9f80f7/src/backend/tcop/postgres.c#L3473-L3501"}},{"Kind":"sources","Ordinal":3,"ID":"src.config.18.6","ServerVersion":null,"Status":null,"Payload":{"commit":"724edf9bde9d356724ad384a2e196edc3c9f80f7","docs_url":"https://www.postgresql.org/docs/18/runtime-config-client.html","kind":"upstream_source","location":"","path":"doc/src/sgml/config.sgml","position":3,"sha256":"ffca322c15315ba670733d6b320f23cbba7374db0d18937298ffc07b58799ef6","source_id":"src.config.18.6","tag":"REL_18_6","url":"https://github.com/postgres/postgres/blob/724edf9bde9d356724ad384a2e196edc3c9f80f7/doc/src/sgml/config.sgml#L10252-L10347"}},{"Kind":"sources","Ordinal":4,"ID":"doc.monitoring.18.6","ServerVersion":null,"Status":null,"Payload":{"commit":"724edf9bde9d356724ad384a2e196edc3c9f80f7","docs_url":"https://www.postgresql.org/docs/18/monitoring-stats.html","kind":"upstream_source","location":"","path":"doc/src/sgml/monitoring.sgml","position":4,"sha256":"06b147f8d966fe46821871703ffcee8a3449cc3f7de5b64b9177f48569fe96f6","source_id":"doc.monitoring.18.6","tag":"REL_18_6","url":"https://github.com/postgres/postgres/blob/724edf9bde9d356724ad384a2e196edc3c9f80f7/doc/src/sgml/monitoring.sgml#L706-L875"}},{"Kind":"sources","Ordinal":5,"ID":"src.system_views.18.6","ServerVersion":null,"Status":null,"Payload":{"commit":"724edf9bde9d356724ad384a2e196edc3c9f80f7","docs_url":"https://www.postgresql.org/docs/18/view-pg-settings.html","kind":"upstream_source","location":"","path":"src/backend/catalog/system_views.sql","position":5,"sha256":"418f4ae7472fe0742e6fbdc7a055581602c5131e082aa6f17e2c7269bf711972","source_id":"src.system_views.18.6","tag":"REL_18_6","url":"https://github.com/postgres/postgres/blob/724edf9bde9d356724ad384a2e196edc3c9f80f7/src/backend/catalog/system_views.sql#L604-L605"}},{"Kind":"sources","Ordinal":6,"ID":"doc.protocol.18.6","ServerVersion":null,"Status":null,"Payload":{"commit":"724edf9bde9d356724ad384a2e196edc3c9f80f7","docs_url":"https://www.postgresql.org/docs/18/protocol.html","kind":"upstream_source","location":"","path":"doc/src/sgml/protocol.sgml","position":6,"sha256":"745339e07ebbc2bb67d98b258e25772ada644ef26011e3cd6b3fcbb435235f89","source_id":"doc.protocol.18.6","tag":"REL_18_6","url":"https://github.com/postgres/postgres/blob/724edf9bde9d356724ad384a2e196edc3c9f80f7/doc/src/sgml/protocol.sgml#L61-L65"}}]}
