{
  "schema": 1,
  "sqlstate": "42P05",
  "condition_name": "duplicate_prepared_statement",
  "sources": [
    {
      "id": "src.errcodes.42P05.18.6",
      "kind": "upstream_source",
      "source_role": "condition_definition",
      "tag": "REL_18_6",
      "commit": "724edf9bde9d356724ad384a2e196edc3c9f80f7",
      "path": "src/backend/utils/errcodes.txt",
      "location": "line 381",
      "sha256": "6e8de346643ba84aa3c9c6a73360acfc7b2dfb89162c06c08ce9bf5bcd5bbcba",
      "url": "https://github.com/postgres/postgres/blob/724edf9bde9d356724ad384a2e196edc3c9f80f7/src/backend/utils/errcodes.txt#L381"
    },
    {
      "id": "src.call.42P05.b490336894ec11628c1766f2",
      "kind": "upstream_source",
      "source_role": "source_call",
      "tag": "REL_18_6",
      "commit": "724edf9bde9d356724ad384a2e196edc3c9f80f7",
      "path": "src/backend/commands/prepare.c",
      "location": "lines 412-415",
      "sha256": "e37fbd5f7618e5554561d9293d8c3af7cf3190c62c5c6bbceb3fe8b97be17956",
      "url": "https://github.com/postgres/postgres/blob/724edf9bde9d356724ad384a2e196edc3c9f80f7/src/backend/commands/prepare.c#L412-L415"
    },
    {
      "id": "src.call.42P05.lifecycle",
      "kind": "upstream_source",
      "source_role": "source_call",
      "tag": "REL_18_6",
      "commit": "724edf9bde9d356724ad384a2e196edc3c9f80f7",
      "path": "src/backend/commands/prepare.c",
      "location": "lines 401-423 and 504-511",
      "sha256": "e37fbd5f7618e5554561d9293d8c3af7cf3190c62c5c6bbceb3fe8b97be17956",
      "url": "https://github.com/postgres/postgres/blob/724edf9bde9d356724ad384a2e196edc3c9f80f7/src/backend/commands/prepare.c#L401-L423"
    },
    {
      "id": "src.calls.REL_18_6.42P05",
      "kind": "local_artifact",
      "source_role": "source_call_scan",
      "sha256": "9ee8a0e81d8f0825c5c1ae45583439859a26e602bdd4ce2f2a62aa278867ccbf"
    }
  ],
  "claims": [
    {
      "id": "identity.class-and-condition",
      "statement": "42P05 is the duplicate_prepared_statement condition in Class 42.",
      "method": "Read fixed REL_18_6 errcodes.txt and locked facts.",
      "limits": "Identity does not enumerate all source branches or client failures.",
      "sources": [
        "src.errcodes.42P05.18.6"
      ]
    },
    {
      "id": "mechanism.selected-source-path",
      "statement": "StorePreparedStatement inserts named statements into the current backend's prepared_queries hash and reports ERROR `prepared statement \"%s\" already exists` when HASH_ENTER finds the name. DEALLOCATE removes entries from that backend's hash; another connection has independent state.",
      "method": "Read complete resolved REL_18_6 report groups and message roles.",
      "limits": "Representative confirmed core paths only; not exhaustive historical or extension coverage.",
      "sources": [
        "src.call.42P05.b490336894ec11628c1766f2",
        "src.call.42P05.lifecycle"
      ]
    },
    {
      "id": "versions.catalogue-boundary",
      "statement": "From 7.4 through 18.6 and 19beta3; this catalogue range is not a precise introduction claim. The selected 18.6 source covers insertion and current-backend deallocation, and runtime was not run.",
      "method": "Read locked catalogue facts and definition snapshots.",
      "limits": "First observed release is a lower bound, not precise behavioral introduction.",
      "sources": [
        "src.errcodes.42P05.18.6"
      ]
    }
  ],
  "messages": [
    {
      "id": "message.variant-1",
      "sqlstate": "42P05",
      "severity_source": "explicit ERROR",
      "primary_template": "prepared statement \"%s\" already exists",
      "detail_templates": [],
      "hint_templates": [],
      "roles": [
        {
          "role": "errmsg",
          "template": "prepared statement \"%s\" already exists"
        }
      ],
      "sources": [
        "src.call.42P05.b490336894ec11628c1766f2"
      ],
      "limits": "Placeholders remain dynamic source fields; no concrete runtime value is claimed."
    }
  ],
  "usage_evidence": [
    {
      "scope": "SQLSTATE definition and release identity",
      "status": "definition_only",
      "evidence_ids": [
        "identity.class-and-condition",
        "src.errcodes.42P05.18.6"
      ]
    },
    {
      "scope": "Selected PostgreSQL 18.6 source emitters and message roles",
      "status": "source_path_confirmed",
      "evidence_ids": [
        "mechanism.selected-source-path"
      ]
    },
    {
      "scope": "Natural runtime execution for this batch",
      "status": "unknown",
      "evidence_ids": []
    }
  ],
  "runtime": []
}
