{
  "schema": 1,
  "sqlstate": "P0002",
  "condition_name": "no_data_found",
  "sources": [
    {
      "id": "src.errcodes.18.6",
      "kind": "upstream_source",
      "source_role": "condition_definition",
      "tag": "REL_18_6",
      "commit": "724edf9bde9d356724ad384a2e196edc3c9f80f7",
      "path": "src/backend/utils/errcodes.txt",
      "sha256": "6e8de346643ba84aa3c9c6a73360acfc7b2dfb89162c06c08ce9bf5bcd5bbcba",
      "url": "https://github.com/postgres/postgres/blob/724edf9bde9d356724ad384a2e196edc3c9f80f7/src/backend/utils/errcodes.txt#L492",
      "lines": "492"
    },
    {
      "id": "src.calls.REL_18_6",
      "kind": "local_artifact",
      "source_role": "source_call_scan",
      "sha256": "9ee8a0e81d8f0825c5c1ae45583439859a26e602bdd4ce2f2a62aa278867ccbf"
    },
    {
      "id": "src.path.plpgsql",
      "kind": "upstream_source",
      "source_role": "resolved_report_context",
      "tag": "REL_18_6",
      "commit": "724edf9bde9d356724ad384a2e196edc3c9f80f7",
      "path": "src/pl/plpgsql/src/pl_exec.c",
      "sha256": "0df3c70a6bccf6dddf443fb99e152a16a67009827c44a820597e98e585cb8b20",
      "url": "https://github.com/postgres/postgres/blob/724edf9bde9d356724ad384a2e196edc3c9f80f7/src/pl/plpgsql/src/pl_exec.c#L4384-L4387",
      "lines": "4384-4387,4574-4577"
    },
    {
      "id": "src.path.tablespace",
      "kind": "upstream_source",
      "source_role": "resolved_report_context",
      "tag": "REL_18_6",
      "commit": "724edf9bde9d356724ad384a2e196edc3c9f80f7",
      "path": "src/backend/commands/tablecmds.c",
      "sha256": "422dc8e833df4940755973c757e338295822ba3e4c7266c40669f49f96eb15a9",
      "url": "https://github.com/postgres/postgres/blob/724edf9bde9d356724ad384a2e196edc3c9f80f7/src/backend/commands/tablecmds.c#L17162-L17166",
      "lines": "17162-17166"
    }
  ],
  "claims": [
    {
      "id": "identity",
      "statement": "P0002 is no_data_found in PostgreSQL-specific Class P0.",
      "sources": [
        "src.errcodes.18.6"
      ],
      "method": "Read the fixed definition row."
    },
    {
      "id": "strict-query",
      "statement": "PL/pgSQL fixed paths report P0002 with `query returned no rows` when the checked query produced no row; optional detail is `parameters: %s` when strict-parameter printing is enabled.",
      "sources": [
        "src.path.plpgsql"
      ],
      "method": "Read both pl_exec report groups and their conditional errdetail."
    },
    {
      "id": "notice-path",
      "statement": "A core tablespace path also uses P0002 at NOTICE level for no matching relations in a tablespace.",
      "sources": [
        "src.path.tablespace"
      ],
      "method": "Compare the literal NOTICE level with the PL/pgSQL ERROR paths."
    },
    {
      "id": "scope",
      "statement": "P0002 is not a synonym for every SELECT that happens to return zero rows; the operation and enforcing path determine whether it is raised.",
      "sources": [
        "src.path.plpgsql"
      ],
      "method": "Read the surrounding target-row and strict checks.",
      "limits": "No runtime case was executed in this batch."
    }
  ],
  "messages": [
    {
      "id": "message.no-rows",
      "sqlstate": "P0002",
      "primary_template": "query returned no rows",
      "detail_template": "parameters: %s",
      "severity_source": "ERROR",
      "sources": [
        "src.path.plpgsql"
      ]
    },
    {
      "id": "message.no-tablespace-relations",
      "sqlstate": "P0002",
      "primary_template": "no matching relations in tablespace \"%s\" found",
      "severity_source": "NOTICE",
      "sources": [
        "src.path.tablespace"
      ]
    }
  ],
  "usage_evidence": [
    {
      "scope": "definition",
      "status": "definition_only",
      "evidence_ids": [
        "identity"
      ]
    },
    {
      "scope": "plpgsql-path",
      "status": "source_path_confirmed",
      "evidence_ids": [
        "strict-query"
      ]
    },
    {
      "scope": "tablespace-notice",
      "status": "source_path_confirmed",
      "evidence_ids": [
        "notice-path"
      ]
    },
    {
      "scope": "natural-runtime",
      "status": "unknown",
      "evidence_ids": [
        "scope"
      ]
    }
  ],
  "runtime": []
}
