{
  "schema": 1,
  "sqlstate": "53300",
  "condition_name": "too_many_connections",
  "sources": [
    {
      "commit": "724edf9bde9d356724ad384a2e196edc3c9f80f7",
      "id": "src.errcodes.18.6",
      "location": "lines 407-414",
      "path": "src/backend/utils/errcodes.txt",
      "sha256": "6e8de346643ba84aa3c9c6a73360acfc7b2dfb89162c06c08ce9bf5bcd5bbcba",
      "tag": "REL_18_6",
      "url": "https://github.com/postgres/postgres/blob/724edf9bde9d356724ad384a2e196edc3c9f80f7/src/backend/utils/errcodes.txt"
    },
    {
      "commit": "724edf9bde9d356724ad384a2e196edc3c9f80f7",
      "id": "src.backend-startup.18.6",
      "location": "lines 340-344",
      "path": "src/backend/tcop/backend_startup.c",
      "sha256": "5516f3d6d83ae6fc66ca6bad9a7cea3cd2f8de53f0597c26baa2bd224ac270bb",
      "tag": "REL_18_6",
      "url": "https://github.com/postgres/postgres/blob/724edf9bde9d356724ad384a2e196edc3c9f80f7/src/backend/tcop/backend_startup.c#L340-L344"
    },
    {
      "commit": "724edf9bde9d356724ad384a2e196edc3c9f80f7",
      "id": "src.miscinit.18.6",
      "location": "lines 868-880",
      "path": "src/backend/utils/init/miscinit.c",
      "sha256": "54bdb859c143a6c70d86067ccf2e124f59aa0852e5705bb653652e41a60af39a",
      "tag": "REL_18_6",
      "url": "https://github.com/postgres/postgres/blob/724edf9bde9d356724ad384a2e196edc3c9f80f7/src/backend/utils/init/miscinit.c#L868-L880"
    },
    {
      "commit": "724edf9bde9d356724ad384a2e196edc3c9f80f7",
      "id": "doc.protocol.18",
      "location": "ErrorResponse fields",
      "path": "doc/src/sgml/protocol.sgml",
      "sha256": "745339e07ebbc2bb67d98b258e25772ada644ef26011e3cd6b3fcbb435235f89",
      "tag": "PG18-docs",
      "url": "https://www.postgresql.org/docs/18/protocol-error-fields.html"
    },
    {
      "id": "manifest.53300",
      "kind": "local_artifact",
      "location": "snapshots and definition_blobs entries for the 53300 definition",
      "sha256": "1727a275f336988ff96b4f9990a4ca253080f73fc5d316e7def165c8cf3708a8"
    },
    {
      "id": "case-manifest.53300",
      "kind": "local_artifact",
      "location": "role_connection_limit",
      "sha256": "631e5ca3a0056fe00b6d1495ddbe4a7880a5d4c09b1520c2ee972859d9174d4d"
    },
    {
      "id": "snippet-registry.53300.final",
      "kind": "local_artifact",
      "location": "role_connection_limit ordered SQL",
      "sha256": "a83d740917ef53c3bf24494c12fe87f4c9cbb38f1e23c17991f2431ba13fa243"
    }
  ],
  "claims": [
    {
      "id": "identity.class-and-condition",
      "limits": "Directory identity does not identify whether a role, database, or server-wide capacity limit caused an occurrence.",
      "method": "Read the Class 53 section and 53300 row in the frozen errcodes.txt snapshot.",
      "sources": [
        "src.errcodes.18.6"
      ],
      "statement": "53300 is the too_many_connections condition in Class 53 insufficient_resources."
    },
    {
      "id": "mechanism.role-connection-limit",
      "limits": "This source path is role-specific; other capacity paths can use 53300 with different messages.",
      "method": "Read the role connection-limit branch, explicit ERRCODE_TOO_MANY_CONNECTIONS, message construction, and concurrency comment.",
      "sources": [
        "src.miscinit.18.6"
      ],
      "statement": "During backend startup, a non-superuser role whose CountUserBackends result exceeds rolconnlimit receives FATAL SQLSTATE 53300 with too many connections for role \"%s\"; the source documents the count check as approximate under a race."
    },
    {
      "id": "mechanism.server-capacity",
      "limits": "This is a source-confirmed server-wide startup gate; it is not covered by the role-limit runtime case and does not classify database or operating-system resource failures.",
      "method": "Read the CAC_TOOMANY backend-startup branch in the fixed source.",
      "sources": [
        "src.backend-startup.18.6"
      ],
      "statement": "The server-wide startup capacity gate also reports SQLSTATE 53300 at FATAL with sorry, too many clients already."
    },
    {
      "id": "runtime.driver-collector-boundary",
      "limits": "Driver exposure can vary by client and startup failure; the collector record is the server-side SQLSTATE evidence here.",
      "method": "Compare the driver diagnostic, CSV collector state_code, message, severity, and source location in both final summaries and raw records.",
      "sources": [
        "doc.protocol.18",
        "runtime.53300-registry-final-20260909.latest",
        "runtime.53300-registry-final-20260909.pg10"
      ],
      "statement": "For the rejected startup connection, psycopg exposed startup text with sqlstate null while the PostgreSQL collector recorded FATAL SQLSTATE 53300 and the role-limit message on both targets."
    },
    {
      "id": "runtime.capacity-repair",
      "limits": "The repair proves the role-limit path only; it does not prove recovery of another global capacity limit.",
      "method": "Keep one holder session, trigger the second startup, restore the limit through an owner connection, and assert a new role session and query.",
      "sources": [
        "case-manifest.53300",
        "snippet-registry.53300.final",
        "runtime.53300-registry-final-20260909.latest",
        "runtime.53300-registry-final-20260909.pg10"
      ],
      "statement": "After resetting the disposable role's connection limit, a fresh connection for that role executed SELECT 1 and returned 1 on PostgreSQL 18.6 and 10.21."
    },
    {
      "id": "versions.catalogue-boundary",
      "limits": "The first scanned release is a lower bound, not an asserted introduction version.",
      "method": "Read the manifest snapshots and definition references for the code.",
      "sources": [
        "manifest.53300"
      ],
      "statement": "The locked catalogue records 53300 in every listed formal snapshot from 9.0.23 through 18.6 and in 19beta3; pre-9.0 history is not scanned."
    }
  ],
  "messages": [
    {
      "id": "message.server-capacity",
      "limits": "This template belongs to the server-wide startup gate and is distinct from the role-limit template.",
      "primary_template": "sorry, too many clients already",
      "severity_source": "explicit FATAL",
      "sources": [
        "src.backend-startup.18.6"
      ],
      "sqlstate": "53300"
    },
    {
      "id": "message.role-limit",
      "limits": "The role name is dynamically inserted; database-wide and server-wide capacity branches may use another primary template.",
      "primary_template": "too many connections for role \"%s\"",
      "severity_source": "explicit FATAL",
      "sources": [
        "src.miscinit.18.6"
      ],
      "sqlstate": "53300"
    }
  ],
  "usage_evidence": [
    {
      "evidence_ids": [
        "identity.class-and-condition",
        "src.errcodes.18.6"
      ],
      "scope": "SQLSTATE directory identity",
      "status": "definition_only"
    },
    {
      "evidence_ids": [
        "mechanism.role-connection-limit",
        "mechanism.server-capacity",
        "message.role-limit",
        "message.server-capacity",
        "src.miscinit.18.6",
        "src.backend-startup.18.6"
      ],
      "scope": "Role-limit and server-wide capacity source paths and messages",
      "status": "source_path_confirmed"
    },
    {
      "evidence_ids": [
        "runtime.driver-collector-boundary",
        "runtime.capacity-repair",
        "snippet-registry.53300.final",
        "runtime.53300-registry-final-20260909.latest",
        "runtime.53300-registry-final-20260909.pg10"
      ],
      "scope": "Startup driver/collector SQLSTATE boundary and role-limit repair",
      "status": "observed_runtime"
    },
    {
      "evidence_ids": [
        "versions.catalogue-boundary",
        "manifest.53300"
      ],
      "scope": "Version presence",
      "status": "definition_only"
    }
  ],
  "runtime": [
    {
      "cases": [
        "role_connection_limit"
      ],
      "id": "runtime.53300-registry-final-20260909.latest",
      "observed": {
        "collector_message": "too many connections for role <generated-role>",
        "collector_severity": "FATAL",
        "collector_source": "miscinit.c:880",
        "collector_sqlstate": "53300",
        "driver_sqlstate": null,
        "driver_text": "FATAL: too many connections for role <generated-role>",
        "restored_query": 1,
        "transaction": "none opened for rejected startup"
      },
      "raw_sha256": "5fbcf85150b62d596ca4b2356639fdcd89ca2a910447e2be9029b90de108a635",
      "run_id": "53300-registry-final-20260909",
      "server_version": "18.6 (Homebrew)",
      "server_version_num": 180006,
      "snippet_registry": {
        "sha256": "a83d740917ef53c3bf24494c12fe87f4c9cbb38f1e23c17991f2431ba13fa243"
      },
      "status": "passed",
      "summary_sha256": "e5505e6d644d9f68ba723c9af63fe069e69d030d1f554b8e8d37316b441f55a9",
      "target": "latest"
    },
    {
      "cases": [
        "role_connection_limit"
      ],
      "id": "runtime.53300-registry-final-20260909.pg10",
      "image": "postgres@sha256:b2baf8998630663d21370da06387c950e587071bdd307ee34e661cdcc7442bcc",
      "observed": {
        "collector_message": "too many connections for role <generated-role>",
        "collector_severity": "FATAL",
        "collector_source": "miscinit.c:575",
        "collector_sqlstate": "53300",
        "driver_sqlstate": null,
        "driver_text": "FATAL: too many connections for role <generated-role>",
        "restored_query": 1,
        "transaction": "none opened for rejected startup"
      },
      "raw_sha256": "b03ea276f638c91efadd0791a9818993fc21620ec27ef643c60b7a9904fac6c3",
      "run_id": "53300-registry-final-20260909",
      "server_version": "10.21 (Debian 10.21-1.pgdg90+1)",
      "server_version_num": 100021,
      "snippet_registry": {
        "sha256": "a83d740917ef53c3bf24494c12fe87f4c9cbb38f1e23c17991f2431ba13fa243"
      },
      "status": "passed",
      "summary_sha256": "2ed0896c1548c0a3115e55381e03b0ccd392abe241552b574c64e88cca052f59",
      "target": "pg10"
    }
  ]
}
