{
  "schema": 1,
  "sqlstate": "42P04",
  "condition_name": "duplicate_database",
  "sources": [
    {
      "id": "src.errcodes.42P04.18.6",
      "kind": "upstream_source",
      "source_role": "condition_definition",
      "tag": "REL_18_6",
      "commit": "724edf9bde9d356724ad384a2e196edc3c9f80f7",
      "path": "src/backend/utils/errcodes.txt",
      "location": "line 379",
      "sha256": "6e8de346643ba84aa3c9c6a73360acfc7b2dfb89162c06c08ce9bf5bcd5bbcba",
      "url": "https://github.com/postgres/postgres/blob/724edf9bde9d356724ad384a2e196edc3c9f80f7/src/backend/utils/errcodes.txt#L379"
    },
    {
      "id": "src.call.42P04.465a77b5605c341bc91f6990",
      "kind": "upstream_source",
      "source_role": "source_call",
      "tag": "REL_18_6",
      "commit": "724edf9bde9d356724ad384a2e196edc3c9f80f7",
      "path": "src/backend/commands/dbcommands.c",
      "location": "lines 1393-1395",
      "sha256": "64b77d2197dce16eb1ad19d8168382459d621a03df0b00be157f7db39ca22acf",
      "url": "https://github.com/postgres/postgres/blob/724edf9bde9d356724ad384a2e196edc3c9f80f7/src/backend/commands/dbcommands.c#L1393-L1395"
    },
    {
      "id": "src.call.42P04.b0d1644def83c14a7504fec4",
      "kind": "upstream_source",
      "source_role": "source_call",
      "tag": "REL_18_6",
      "commit": "724edf9bde9d356724ad384a2e196edc3c9f80f7",
      "path": "src/backend/commands/dbcommands.c",
      "location": "lines 1949-1951",
      "sha256": "64b77d2197dce16eb1ad19d8168382459d621a03df0b00be157f7db39ca22acf",
      "url": "https://github.com/postgres/postgres/blob/724edf9bde9d356724ad384a2e196edc3c9f80f7/src/backend/commands/dbcommands.c#L1949-L1951"
    },
    {
      "id": "src.call.42P04.create-tx-guard",
      "kind": "upstream_source",
      "source_role": "source_call",
      "tag": "REL_18_6",
      "commit": "724edf9bde9d356724ad384a2e196edc3c9f80f7",
      "path": "src/backend/tcop/utility.c",
      "location": "lines 769-773",
      "sha256": "7aae5d07628b6debf8456d1d4ea96f28912232192e56ea25773b4c4b61235a00",
      "url": "https://github.com/postgres/postgres/blob/724edf9bde9d356724ad384a2e196edc3c9f80f7/src/backend/tcop/utility.c#L769-L773"
    },
    {
      "id": "src.calls.REL_18_6.42P04",
      "kind": "local_artifact",
      "source_role": "source_call_scan",
      "sha256": "9ee8a0e81d8f0825c5c1ae45583439859a26e602bdd4ce2f2a62aa278867ccbf"
    }
  ],
  "claims": [
    {
      "id": "identity.class-and-condition",
      "statement": "42P04 is the duplicate_database 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.42P04.18.6"
      ]
    },
    {
      "id": "mechanism.selected-source-path",
      "statement": "createdb checks the requested database name and RenameDatabase checks newname after old-database ownership and CREATEDB checks; both report ERROR `database \"%s\" already exists`. The utility dispatcher separately calls PreventInTransactionBlock for CREATE DATABASE before createdb, so an explicit transaction-block failure is not 42P04.",
      "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.42P04.465a77b5605c341bc91f6990",
        "src.call.42P04.b0d1644def83c14a7504fec4",
        "src.call.42P04.create-tx-guard"
      ]
    },
    {
      "id": "versions.catalogue-boundary",
      "statement": "From 7.4 through 18.6 and 19beta3; this catalogue range is not a precise introduction claim. The selected CREATE, RENAME, and dispatcher guards are fixed 18.6 source paths and no runtime case was run.",
      "method": "Read locked catalogue facts and definition snapshots.",
      "limits": "First observed release is a lower bound, not precise behavioral introduction.",
      "sources": [
        "src.errcodes.42P04.18.6"
      ]
    }
  ],
  "messages": [
    {
      "id": "message.variant-1",
      "sqlstate": "42P04",
      "severity_source": "explicit ERROR",
      "primary_template": "database \"%s\" already exists",
      "detail_templates": [],
      "hint_templates": [],
      "roles": [
        {
          "role": "errmsg",
          "template": "database \"%s\" already exists"
        }
      ],
      "sources": [
        "src.call.42P04.465a77b5605c341bc91f6990"
      ],
      "limits": "Placeholders remain dynamic source fields; no concrete runtime value is claimed."
    },
    {
      "id": "message.variant-2",
      "sqlstate": "42P04",
      "severity_source": "explicit ERROR",
      "primary_template": "database \"%s\" already exists",
      "detail_templates": [],
      "hint_templates": [],
      "roles": [
        {
          "role": "errmsg",
          "template": "database \"%s\" already exists"
        }
      ],
      "sources": [
        "src.call.42P04.b0d1644def83c14a7504fec4"
      ],
      "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.42P04.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": []
}
