{
  "schema": 1,
  "sqlstate": "57014",
  "condition_name": "query_canceled",
  "sources": [
    {
      "commit": "724edf9bde9d356724ad384a2e196edc3c9f80f7",
      "id": "src.errcodes.18.6",
      "location": "lines 432-438",
      "path": "src/backend/utils/errcodes.txt",
      "sha256": "6e8de346643ba84aa3c9c6a73360acfc7b2dfb89162c06c08ce9bf5bcd5bbcba",
      "tag": "REL_18_6",
      "url": "https://github.com/postgres/postgres/blob/724edf9bde9d356724ad384a2e196edc3c9f80f7/src/backend/utils/errcodes.txt"
    },
    {
      "commit": "724edf9bde9d356724ad384a2e196edc3c9f80f7",
      "id": "src.postgres.18.6",
      "location": "lines 3441-3446",
      "path": "src/backend/tcop/postgres.c",
      "sha256": "9fb62275b1badf94d01ab351337b60410cd9b3ab1fe63fa9f23d6d2185a21061",
      "tag": "REL_18_6",
      "url": "https://github.com/postgres/postgres/blob/724edf9bde9d356724ad384a2e196edc3c9f80f7/src/backend/tcop/postgres.c#L3441-L3446"
    },
    {
      "commit": "724edf9bde9d356724ad384a2e196edc3c9f80f7",
      "id": "doc.config.18",
      "location": "statement_timeout configuration",
      "path": "doc/src/sgml/config.sgml",
      "sha256": "ffca322c15315ba670733d6b320f23cbba7374db0d18937298ffc07b58799ef6",
      "tag": "PG18-docs",
      "url": "https://www.postgresql.org/docs/18/runtime-config-client.html#GUC-STATEMENT-TIMEOUT"
    },
    {
      "commit": "724edf9bde9d356724ad384a2e196edc3c9f80f7",
      "id": "doc.protocol.18",
      "location": "ErrorResponse fields",
      "path": "doc/src/sgml/protocol.sgml",
      "sha256": "745339e07ebbc2bb67d98b258e25772ada644ef26011e3cd6b3fcbb435235f89",
      "tag": "PG18-docs",
      "url": "https://www.postgresql.org/docs/18/protocol-error-fields.html"
    },
    {
      "id": "manifest.57014",
      "kind": "local_artifact",
      "location": "snapshots and definition_blobs entries for the 57014 definition",
      "sha256": "1727a275f336988ff96b4f9990a4ca253080f73fc5d316e7def165c8cf3708a8"
    },
    {
      "id": "case-manifest.57014",
      "kind": "local_artifact",
      "location": "statement_timeout_cancel",
      "sha256": "af2f28389fba25445dae975fda3a035ef9d69d7210f8f414585801aaf8c0282d"
    },
    {
      "id": "snippet-registry.57014.final",
      "kind": "local_artifact",
      "location": "statement_timeout_cancel ordered SQL",
      "sha256": "f6cf9d26837aae084280538fc4283418b23f160838b581c67eaf0e22d8c6715d"
    }
  ],
  "claims": [
    {
      "id": "identity.class-and-condition",
      "limits": "The directory condition covers several cancellation sources.",
      "method": "Read the Class 57 section and 57014 row in the frozen errcodes.txt snapshot.",
      "sources": [
        "src.errcodes.18.6"
      ],
      "statement": "57014 is the query_canceled condition in Class 57 operator_intervention."
    },
    {
      "id": "mechanism.statement-timeout",
      "limits": "User cancel, lock timeout, recovery conflict, and administrative cancel paths can use the same SQLSTATE with different messages or effects.",
      "method": "Read the ProcessInterrupts timeout branch and the official statement_timeout behavior documentation.",
      "sources": [
        "src.postgres.18.6",
        "doc.config.18"
      ],
      "statement": "The statement-timeout interrupt path reports ERRCODE_QUERY_CANCELED with canceling statement due to statement timeout."
    },
    {
      "id": "runtime.autocommit-followup",
      "limits": "The run covers statement timeout on an autocommit connection and does not establish transaction effects for canceled writes or explicit transactions.",
      "method": "Set statement_timeout, execute the long sleep, capture diagnostics and status, and assert the follow-up query and final status.",
      "sources": [
        "case-manifest.57014",
        "snippet-registry.57014.final",
        "runtime.57014-registry-final-20260909.latest",
        "runtime.57014-registry-final-20260909.pg10"
      ],
      "statement": "A 100 ms statement_timeout canceled pg_sleep(1) with SQLSTATE 57014 and left the autocommit connection IDLE; SELECT 1 then returned 1 on both targets."
    },
    {
      "id": "versions.catalogue-boundary",
      "limits": "The first scanned release is a lower bound, not an asserted introduction version.",
      "method": "Read the manifest snapshots and definition references for the code.",
      "sources": [
        "manifest.57014"
      ],
      "statement": "The locked catalogue records 57014 in every listed formal snapshot from 9.0.23 through 18.6 and in 19beta3; pre-9.0 history is not scanned."
    }
  ],
  "messages": [
    {
      "id": "message.statement-timeout",
      "limits": "This template identifies the statement_timeout path; other query-canceled paths have their own messages.",
      "primary_template": "canceling statement due to statement timeout",
      "severity_source": "explicit ERROR",
      "sources": [
        "src.postgres.18.6"
      ],
      "sqlstate": "57014"
    }
  ],
  "usage_evidence": [
    {
      "evidence_ids": [
        "identity.class-and-condition",
        "src.errcodes.18.6"
      ],
      "scope": "SQLSTATE directory identity",
      "status": "definition_only"
    },
    {
      "evidence_ids": [
        "mechanism.statement-timeout",
        "message.statement-timeout",
        "src.postgres.18.6",
        "doc.config.18"
      ],
      "scope": "Statement-timeout mechanism and message",
      "status": "source_path_confirmed"
    },
    {
      "evidence_ids": [
        "runtime.autocommit-followup",
        "snippet-registry.57014.final",
        "runtime.57014-registry-final-20260909.latest",
        "runtime.57014-registry-final-20260909.pg10"
      ],
      "scope": "Autocommit cancellation and follow-up query",
      "status": "observed_runtime"
    },
    {
      "evidence_ids": [
        "versions.catalogue-boundary",
        "manifest.57014"
      ],
      "scope": "Version presence",
      "status": "definition_only"
    }
  ],
  "runtime": [
    {
      "cases": [
        "statement_timeout_cancel"
      ],
      "id": "runtime.57014-registry-final-20260909.latest",
      "observed": {
        "diagnostic": {
          "message_primary": "canceling statement due to statement timeout",
          "severity": "ERROR",
          "source_file": "postgres.c",
          "source_function": "ProcessInterrupts",
          "source_line": "3446",
          "sqlstate": "57014"
        },
        "followup": 1,
        "statuses": {
          "after_cancel": "IDLE",
          "after_followup": "IDLE"
        }
      },
      "raw_sha256": "dabaaf0b01d0c45133ea2d3e85ba3272e436cf75b95c7681b608b1b96cb9a99f",
      "run_id": "57014-registry-final-20260909",
      "server_version": "18.6 (Homebrew)",
      "server_version_num": 180006,
      "snippet_registry": {
        "sha256": "f6cf9d26837aae084280538fc4283418b23f160838b581c67eaf0e22d8c6715d"
      },
      "status": "passed",
      "summary_sha256": "8e310974fb6160095bd37df9c259419289e44a2c62ab42d72218e906a2ef8bbc",
      "target": "latest"
    },
    {
      "cases": [
        "statement_timeout_cancel"
      ],
      "id": "runtime.57014-registry-final-20260909.pg10",
      "image": "postgres@sha256:b2baf8998630663d21370da06387c950e587071bdd307ee34e661cdcc7442bcc",
      "observed": {
        "diagnostic": {
          "message_primary": "canceling statement due to statement timeout",
          "severity": "ERROR",
          "source_file": "postgres.c",
          "source_function": "ProcessInterrupts",
          "source_line": "3018",
          "sqlstate": "57014"
        },
        "followup": 1,
        "statuses": {
          "after_cancel": "IDLE",
          "after_followup": "IDLE"
        }
      },
      "raw_sha256": "85c6bb64d7e6178c4b2300d5f24d15c356339662f40573180dd230b2c65a3b80",
      "run_id": "57014-registry-final-20260909",
      "server_version": "10.21 (Debian 10.21-1.pgdg90+1)",
      "server_version_num": 100021,
      "snippet_registry": {
        "sha256": "f6cf9d26837aae084280538fc4283418b23f160838b581c67eaf0e22d8c6715d"
      },
      "status": "passed",
      "summary_sha256": "fa02b6c80d94c75f63912def8ffd13dd794792d403749f57de45dd6f860d2dbb",
      "target": "pg10"
    }
  ]
}
