{
  "schema": 1,
  "sqlstate": "58P02",
  "condition_name": "duplicate_file",
  "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#L447",
      "lines": "447"
    },
    {
      "id": "src.path.0",
      "kind": "upstream_source",
      "source_role": "resolved_report_context",
      "tag": "REL_18_6",
      "commit": "724edf9bde9d356724ad384a2e196edc3c9f80f7",
      "path": "src/backend/backup/basebackup_server.c",
      "sha256": "1447d7223926f903d27744605f9caec8a610d78a9f7a7864bb3afb6b3073ac19",
      "url": "https://github.com/postgres/postgres/blob/724edf9bde9d356724ad384a2e196edc3c9f80f7/src/backend/backup/basebackup_server.c#L59",
      "lines": "59-125"
    }
  ],
  "claims": [
    {
      "id": "identity",
      "statement": "58P02 is duplicate_file in SQLSTATE Class 58.",
      "sources": [
        "src.errcodes.18.6"
      ],
      "method": "Read locked definition snapshot."
    },
    {
      "id": "resolved-paths",
      "statement": "The server-side base-backup sink commits its privilege-check transaction before checking the output directory, accepts empty targets, and emits 58P02 only for an existing non-empty target; other branches use errno-selected codes.",
      "sources": [
        "src.path.0"
      ],
      "method": "Read the complete sink constructor and directory-state switch.",
      "limits": "Source confirmation is not natural runtime."
    },
    {
      "id": "history",
      "statement": "The locked catalogue records 58P02 from 7.4; it does not prove every historical duplicate-file caller.",
      "sources": [
        "src.errcodes.18.6"
      ],
      "method": "Use locked catalogue boundary."
    }
  ],
  "messages": [
    {
      "id": "message.0",
      "sqlstate": "58P02",
      "primary_template": "directory \"%s\" exists but is not empty",
      "severity_source": "ERROR",
      "sources": [
        "src.path.0"
      ]
    },
    {
      "id": "message.1",
      "sqlstate": "58P02",
      "primary_template": "could not access directory \"%s\": %m",
      "severity_source": "ERROR",
      "sources": [
        "src.path.0"
      ],
      "code_selection": "errcode_for_file_access()"
    },
    {
      "id": "message.2",
      "sqlstate": "58P02",
      "primary_template": "could not create directory \"%s\": %m",
      "severity_source": "ERROR",
      "sources": [
        "src.path.0"
      ],
      "code_selection": "errcode_for_file_access()"
    }
  ],
  "usage_evidence": [
    {
      "scope": "definition",
      "status": "definition_only",
      "evidence_ids": [
        "identity"
      ]
    },
    {
      "scope": "fixed-source-path",
      "status": "source_path_confirmed",
      "evidence_ids": [
        "resolved-paths"
      ]
    },
    {
      "scope": "history",
      "status": "unknown",
      "evidence_ids": [
        "history"
      ]
    },
    {
      "scope": "natural-runtime",
      "status": "unknown",
      "evidence_ids": [
        "resolved-paths"
      ]
    }
  ],
  "runtime": []
}
