{
  "schema": 1,
  "sqlstate": "58P01",
  "condition_name": "undefined_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#L446",
      "lines": "446"
    },
    {
      "id": "src.path.0",
      "kind": "upstream_source",
      "source_role": "resolved_report_context",
      "tag": "REL_18_6",
      "commit": "724edf9bde9d356724ad384a2e196edc3c9f80f7",
      "path": "src/backend/commands/tablespace.c",
      "sha256": "f0369bece6339d18cd7d4a29b5fa3010447c3b8ece235c64b0d4fbf5f96a5317",
      "url": "https://github.com/postgres/postgres/blob/724edf9bde9d356724ad384a2e196edc3c9f80f7/src/backend/commands/tablespace.c#L347",
      "lines": "347-359,565-625,1515-1525"
    },
    {
      "id": "src.path.1",
      "kind": "upstream_source",
      "source_role": "utility_transaction_guard",
      "tag": "REL_18_6",
      "commit": "724edf9bde9d356724ad384a2e196edc3c9f80f7",
      "path": "src/backend/tcop/utility.c",
      "sha256": "7aae5d07628b6debf8456d1d4ea96f28912232192e56ea25773b4c4b61235a00",
      "url": "https://github.com/postgres/postgres/blob/724edf9bde9d356724ad384a2e196edc3c9f80f7/src/backend/tcop/utility.c#L713",
      "lines": "713-717"
    }
  ],
  "claims": [
    {
      "id": "identity",
      "statement": "58P01 is undefined_file in SQLSTATE Class 58.",
      "sources": [
        "src.errcodes.18.6"
      ],
      "method": "Read locked definition snapshot."
    },
    {
      "id": "resolved-paths",
      "statement": "The utility dispatcher rejects CREATE TABLESPACE inside a transaction block before entering CreateTableSpace; the tablespace directory helper uses explicit 58P01 for ENOENT from chmod, conditionally adds its recovery hint, and uses errno-selected file-access codes for other directory failures.",
      "sources": [
        "src.path.0",
        "src.path.1"
      ],
      "method": "Read the utility transaction guard, SQL caller, complete directory helper, and WAL-replay caller.",
      "limits": "Source confirmation is not natural runtime."
    },
    {
      "id": "history",
      "statement": "The locked catalogue records 58P01 from 7.4; it does not prove the exact introduction or every historical caller.",
      "sources": [
        "src.errcodes.18.6"
      ],
      "method": "Use locked catalogue boundary."
    }
  ],
  "messages": [
    {
      "id": "message.0",
      "sqlstate": "58P01",
      "primary_template": "directory \"%s\" does not exist",
      "severity_source": "ERROR",
      "sources": [
        "src.path.0"
      ],
      "hint_template": "Create this directory for the tablespace before restarting the server.",
      "hint_condition": "InRecovery"
    },
    {
      "id": "message.1",
      "sqlstate": "58P01",
      "primary_template": "could not set permissions on directory \"%s\": %m",
      "severity_source": "ERROR",
      "sources": [
        "src.path.0"
      ],
      "code_selection": "errcode_for_file_access()"
    },
    {
      "id": "message.2",
      "sqlstate": "58P01",
      "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": []
}
