↑↓ 选择↵ 打开⌫ 切换范围完整搜索

PG.CENTER 连接 PostgreSQL 文档、百科与生态知识。由 Pigsty 维护。

Wiki / SQLSTATE

28000 — 授权规范无效(invalid_authorization_specification)

授权规范无效,如登录角色不存在或 HBA 拒绝。

英文手册覆盖始于 PostgreSQL 8.1. 来源历史与运行验证各自保留独立版本边界。

当前阅读 PG 18·选择有来源记录的版本

aliases
未知
class name
Invalid Authorization Specification
condition name
invalid_authorization_specification
lang
en
sqlstate
28000

版本定义 PG 18

28000 — 授权规范无效

速览 {#at-a-glance}

SQLSTATE 28000 是 Class 28 中的 invalid_authorization_specification。28000 是被拒绝的启动或授权上下文所属的类别。选定的角色不存在启动路径在建立会话前发送 C=28000、S=FATAL 以及 role "<generated>" does not exist;固定认证路径还在证书、pg_hba 和 LOGIN 资格失败时使用本类的具体报文。

含义 {#meaning}

本类覆盖建立或认证连接时被拒绝的授权上下文。选定分支是启动阶段的角色查找:服务器无法为请求角色创建会话,于是发送 FATAL ErrorResponse。证书、pg_hba 和 LOGIN 资格路径仍是同一类别下的不同 producer。

选定的角色查找发生在后端进入普通会话之前。这解释了 FATAL 级别以及失败尝试没有会话级事务。不要把它与 28P01(密码认证失败)、42501(会话建立后的权限不足)或 3D000(数据库选择)混在一起;应由启动阶段和服务器字段确定分支。

启动分支指引 {#scenarios}

| 检查内容 | 选定的角色缺失分支 | Class 28 的其他可能性 | | --- | --- | --- | | 服务器字段 | C=28000、S=FATAL、M=role "%s" does not exist | 保留服务器实际返回的代码和主报文,不能只按类别推断。 | | 会话状态 | 失败尝试没有可用会话,也没有事务 | 后续授权检查可能发生在已建立会话中,恢复边界不同。 | | 修复 | 按意图创建/重命名角色,或修正启动用户,然后重新连接 | 根据实际诊断修正证书、pg_hba.conf、LOGIN 属性或映射。 |

诊断 {#diagnosis}

以服务器 ErrorResponse 或认证日志作为 SQLSTATE 依据,并先判断阶段:角色查找、pg_hba 规则、证书,还是 LOGIN 权限。选定的 collector 是原始服务器 ErrorResponse 记录,不是 csvlog/jsonlog;原始启动尝试与 psycopg 尝试彼此独立。选定运行中 psycopg 报告的驱动 SQLSTATE 为 null,失败连接没有事务;两个独立的新鲜已知角色探针仍能执行 SELECT 1,这不是日志采集器关联结论。

对于角色不存在,使用独立管理会话对照请求的启动用户和角色目录,并检查引号或大小写折叠。保留原始 C、S、M 字段:psycopg 的 null 只说明它自己的失败启动尝试,不表示服务器没有 SQLSTATE。新鲜探针必须是另一条连接,不能把失败尝试变成可回滚的事务。

处理 {#response}

按服务器指出的原因修正角色、LOGIN/映射、证书或 pg_hba 规则,再建立新连接。失败启动连接上没有可供 ROLLBACK 的会话;没有服务器字段时不能仅凭客户端异常认定 28000,也不要盲目重放非幂等启动工作。

角色或认证配置改变后,使用准确的目标用户和数据库重新连接,并在新会话中确认身份。如果应用已经在另一条连接上发送了工作,应单独核对那部分工作;启动前的 FATAL 本身没有可重试的业务事务。

实测诊断 {#messages}

选定的启动角色分支以 FATAL 发出主报文 role "%s" does not exist,角色名是动态值。Class 28 的其他授权失败可能使用不同主报文。由于客户端没有得到可用会话 SQLSTATE,应以服务器 ErrorResponse 为准。

选定服务器记录为 role "u28000_missing_fbc912bb7e6f" does not exist,角色名是本次运行生成的值。原始 ErrorResponse 与 psycopg 的 null 属于两次独立启动尝试,不能拼成同一会话的两种视图。

代表案例 {#case}

注册表包含服务器启动 ErrorResponse 后执行的探针。触发点是在新启动连接上使用随机角色,失败发生在会话建立前,不能用 SQL 语句重现。

SELECT 1;

18.6 服务器 ErrorResponse 为 C=28000、S=FATAL、role "u28000_missing_fbc912bb7e6f" does not exist。驱动启动诊断的 SQLSTATE 为 null,失败连接没有事务;已知可用连接探针返回 1,状态 IDLE。

可下载的案例与证据投影分别是 28000 案例 JSON 和 作者证据。运行器清单为 verify/cases/28000/cases.json;发布前会将页面 SQL 与共享注册表比对。

版本 {#versions}

上面的生成事实表记录锁定的目录快照和最早观察到的定义。本页自然运行范围是 PostgreSQL 18.6 与 10.21,不能据此推断所有中间版本的行为。

相关 {#related}

来源 {#sources}

  • src.miscinit-missing-role.18.6 — src/backend/utils/init/miscinit.c at REL_18_6 commit 724edf9bde9d356724ad384a2e196edc3c9f80f7; fixed blob SHA-256 54bdb859c143a6c70d86067ccf2e124f59aa0852e5705bb653652e41a60af39a (source).
  • src.miscinit-missing-role.10.23 — src/backend/utils/init/miscinit.c at REL_10_23 commit 02991e79f8f58bc208f05dcc8af0c62dbe0a6ea4; fixed blob SHA-256 c4d2e234f96644d43aad9e9a6728df693e7f75175f05a550701413ceee70fb82 (source).
  • src.calls.REL_18_6 / src.calls.REL_10_23 — fixed local call scans, SHA-256 9ee8a0e81d8f0825c5c1ae45583439859a26e602bdd4ce2f2a62aa278867ccbf / 00d16d3eb01b71ccf1b245c8f3102f9d0ec9f36fb02777b8dd1b99fcb263040c; these scans preserve the resolved call context used by the claims.

比较版本

SQLSTATE 证据与已记录的运行版本

cases · invalid_authorization
{
  "assertions": [
    "The selected server diagnostic has the expected SQLSTATE",
    "The selected recovery/probe assertions pass",
    "Runner-owned resources are cleaned up"
  ],
  "case_id": "invalid_authorization",
  "cleanup": "Drop the case schema with an owner connection.",
  "has_snippet": true,
  "position": 0,
  "preconditions": [
    "A runner-owned disposable target is provisioned."
  ],
  "repair": "Follow the case-specific repair statements and verify the resulting state.",
  "trigger": "Attempt startup as a generated role that does not exist, then probe a known owner connection.",
  "versions": [
    "10",
    "18"
  ]
}
claims · identity.class-and-condition
{
  "claim_id": "identity.class-and-condition",
  "limits": "Directory identity does not identify every backend or client path.",
  "method": "Read the fixed errcodes.txt definition and the locked catalogue metadata.",
  "position": 0,
  "runtime": [],
  "sources": [
    "src.errcodes.18.6"
  ],
  "statement": "28000 is the invalid_authorization_specification condition in Class 28."
}
claims · mechanism.backend-path
{
  "claim_id": "mechanism.backend-path",
  "limits": "Other calls can retain the same SQLSTATE with different context or text.",
  "method": "Trace the resolved source call records at the fixed release commits and compare their dynamic message fields.",
  "position": 1,
  "runtime": [],
  "sources": [
    "src.miscinit-missing-role.18.6",
    "src.miscinit-missing-role.10.23"
  ],
  "statement": "The fixed source paths associated with 28000 report the condition in the mechanism selected for this page."
}
claims · runtime.representative-case
{
  "claim_id": "runtime.representative-case",
  "limits": "This covers the selected case and versions only; it does not generalize to every driver, proxy, or intermediate release.",
  "method": "Run the shared registry case on isolated runner-owned latest and PG10 targets; inspect the final summaries and raw results.",
  "position": 2,
  "runtime": [
    "runtime.28000-conn-contract-latest.latest",
    "runtime.28000-conn-contract-pg10.pg10"
  ],
  "sources": [
    "snippet-registry.28000",
    "manifest.28000"
  ],
  "statement": "The selected invalid_authorization case passed with the expected structured diagnostics, recovery assertions, and cleanup on PostgreSQL 18.6 and 10.21."
}
claims · startup-phase-boundary
{
  "claim_id": "startup-phase-boundary",
  "limits": "This is the selected missing-role startup branch; other Class 28 producers can occur in different authentication phases and use different diagnostics.",
  "method": "Compare the fixed miscinit.c source path with the selected raw server ErrorResponse and independent driver/probe observations.",
  "position": 3,
  "runtime": [],
  "sources": [
    "src.miscinit-missing-role.18.6",
    "runtime.28000-conn-contract-latest.latest"
  ],
  "statement": "The selected missing-role producer runs during startup, emits a FATAL ErrorResponse, and leaves no usable session or transaction; the server ErrorResponse is therefore authoritative over a client exception with SQLSTATE null."
}
claims · versions.catalogue-boundary
{
  "claim_id": "versions.catalogue-boundary",
  "limits": "Presence in a definition file is not an exact behavioral introduction; the two runtime targets do not prove all middle versions.",
  "method": "Read the generated facts block and locked manifest, then compare the selected target summaries.",
  "position": 4,
  "runtime": [],
  "sources": [
    "src.errcodes.18.6",
    "src.calls.REL_18_6",
    "src.calls.REL_10_23"
  ],
  "statement": "The locked catalogue records 28000 in the listed snapshots; the runtime comparison here is limited to PostgreSQL 18.6 and 10.21."
}
messages · message.missing-role
{
  "limits": "",
  "message_id": "message.missing-role",
  "path": "",
  "position": 0,
  "raw": {
    "id": "message.missing-role",
    "primary_template": "role \"%s\" does not exist",
    "severity_source": "explicit FATAL",
    "sources": [
      "src.miscinit-missing-role.18.6",
      "src.miscinit-missing-role.10.23"
    ],
    "sqlstate": "28000"
  },
  "severity": "explicit FATAL",
  "sources": [
    "src.miscinit-missing-role.18.6",
    "src.miscinit-missing-role.10.23"
  ],
  "templates": [
    {
      "kind": "primary",
      "literal": "role \" \" does not exist",
      "position": 0,
      "role": "",
      "template": "role \"%s\" does not exist"
    }
  ]
}
runtimes · runtime.28000-conn-contract-latest.latest · 18.6 (Homebrew) · passed
{
  "cases": [
    "invalid_authorization"
  ],
  "limits": "Disposable runner-owned target only; this is a bounded mechanism case, not a guarantee for every client or network path.",
  "position": 0,
  "raw": {
    "assertions": [
      {
        "expected": "28000",
        "name": "server authorization SQLSTATE",
        "observed": "28000",
        "passed": true
      },
      {
        "expected": "FATAL",
        "name": "server authorization failure is FATAL",
        "observed": "FATAL",
        "passed": true
      },
      {
        "expected": "role \"u28000_missing_fbc912bb7e6f\" does not exist",
        "name": "server missing-role diagnostic",
        "observed": "role \"u28000_missing_fbc912bb7e6f\" does not exist",
        "passed": true
      },
      {
        "expected": "null (startup exception)",
        "name": "driver startup SQLSTATE boundary",
        "observed": null,
        "passed": true
      },
      {
        "expected": "SELECT 1 and IDLE",
        "name": "known connection remains usable",
        "observed": {
          "probe": 1,
          "status": "IDLE"
        },
        "passed": true
      }
    ],
    "case_manifest": "verify/cases/28000/cases.json",
    "case_manifest_sha256": "188147e72a59764e242b45c406cccd69a56cd8101b210403ebf33cec273693cc",
    "cases": [
      "invalid_authorization"
    ],
    "cleanup": {
      "case": {
        "errors": [],
        "passed": true
      },
      "target_stop": {
        "argv": [
          "/opt/homebrew/Cellar/postgresql@18/18.6/bin/pg_ctl",
          "-D",
          "/Users/vonng/pgcenter/err-code/.cache/runtime/28000-conn-contract-latest/latest/data",
          "-m",
          "fast",
          "-w",
          "stop"
        ],
        "elapsed_seconds": 0.109,
        "returncode": 0,
        "stderr": "",
        "stdout": "waiting for server to shut down.... done\nserver stopped\n"
      }
    },
    "environment": {
      "lc_messages": "C",
      "libpq_version": "18.6",
      "locale": "en_US.UTF-8",
      "log_destination": "csvlog,jsonlog",
      "machine": "arm64",
      "platform": "macOS-26.6.2-arm64-arm-64bit-Mach-O",
      "psycopg_version": "3.3.5",
      "python_version": "3.14.6 (main, Jun 10 2026, 10:03:53) [Clang 21.0.0 (clang-2100.0.123.102)]",
      "server_version": "18.6 (Homebrew)",
      "server_version_num": "180006",
      "target_kind": "latest"
    },
    "id": "runtime.28000-conn-contract-latest.latest",
    "kind": "runtime_observation",
    "limits": "Disposable runner-owned target only; this is a bounded mechanism case, not a guarantee for every client or network path.",
    "observed": {
      "collector": {
        "primary": "role \"u28000_missing_fbc912bb7e6f\" does not exist",
        "severity": "FATAL",
        "sqlstate": "28000"
      },
      "diagnostic": {
        "column_name": null,
        "constraint_name": null,
        "context": null,
        "datatype_name": null,
        "exception_type": "OperationalError",
        "internal_position": null,
        "internal_query": null,
        "message_detail": null,
        "message_hint": null,
        "message_primary": null,
        "schema_name": null,
        "severity": null,
        "severity_nonlocalized": null,
        "source_file": null,
        "source_function": null,
        "source_line": null,
        "sqlstate": null,
        "statement_position": null,
        "table_name": null,
        "text": "connection failed: connection to server at \"127.0.0.1\", port 60047 failed: FATAL:  role \"u28000_missing_fbc912bb7e6f\" does not exist"
      },
      "failed_connection_has_no_transaction": true,
      "missing_role": "u28000_missing_fbc912bb7e6f",
      "probe": 1,
      "probe_status": "IDLE",
      "server_error": {
        "C": "28000",
        "F": "miscinit.c",
        "L": "804",
        "M": "role \"u28000_missing_fbc912bb7e6f\" does not exist",
        "R": "InitializeSessionUserId",
        "S": "FATAL",
        "V": "FATAL"
      }
    },
    "raw": "verify/results/28000-conn-contract-latest/latest/raw.jsonl",
    "raw_sha256": "2389db15803d76e92f3964d387aa15085de2cc094cfefdd2d25aa7790665fb40",
    "run_id": "28000-conn-contract-latest",
    "server_version": "18.6 (Homebrew)",
    "server_version_num": 180006,
    "snippet_registry": {
      "path": "verify/cases/28000/snippets.json",
      "sha256": "30eca9ec77f1b393fb74d2c53a660a7e601da82c26919f453c6fb18bc418f43a"
    },
    "status": "passed",
    "summary": "verify/results/28000-conn-contract-latest/latest/summary.json",
    "summary_sha256": "a75bb39570a63f6e34212585e0330cbca4429c82b886663c5a49f8d9af169e2a",
    "target": "latest"
  },
  "run_id": "28000-conn-contract-latest",
  "runtime_id": "runtime.28000-conn-contract-latest.latest",
  "server_version": "18.6 (Homebrew)",
  "status": "passed",
  "target": "latest"
}
runtimes · runtime.28000-conn-contract-pg10.pg10 · 10.21 (Debian 10.21-1.pgdg90+1) · passed
{
  "cases": [
    "invalid_authorization"
  ],
  "limits": "Disposable runner-owned target only; this is a bounded mechanism case, not a guarantee for every client or network path.",
  "position": 1,
  "raw": {
    "assertions": [
      {
        "expected": "28000",
        "name": "server authorization SQLSTATE",
        "observed": "28000",
        "passed": true
      },
      {
        "expected": "FATAL",
        "name": "server authorization failure is FATAL",
        "observed": "FATAL",
        "passed": true
      },
      {
        "expected": "role \"u28000_missing_25282cee130f\" does not exist",
        "name": "server missing-role diagnostic",
        "observed": "role \"u28000_missing_25282cee130f\" does not exist",
        "passed": true
      },
      {
        "expected": "null (startup exception)",
        "name": "driver startup SQLSTATE boundary",
        "observed": null,
        "passed": true
      },
      {
        "expected": "SELECT 1 and IDLE",
        "name": "known connection remains usable",
        "observed": {
          "probe": 1,
          "status": "IDLE"
        },
        "passed": true
      }
    ],
    "case_manifest": "verify/cases/28000/cases.json",
    "case_manifest_sha256": "188147e72a59764e242b45c406cccd69a56cd8101b210403ebf33cec273693cc",
    "cases": [
      "invalid_authorization"
    ],
    "cleanup": {
      "case": {
        "errors": [],
        "passed": true
      },
      "target_stop": {
        "cleanup": {
          "argv": [
            "/usr/local/bin/docker",
            "rm",
            "-f",
            "-v",
            "sqlstate28000_28000conncontractpg10_pg10"
          ],
          "elapsed_seconds": 0.277,
          "returncode": 0,
          "stderr": "",
          "stdout": "sqlstate28000_28000conncontractpg10_pg10\n"
        },
        "inspect": {
          "argv": [
            "/usr/local/bin/docker",
            "inspect",
            "sqlstate28000_28000conncontractpg10_pg10"
          ],
          "elapsed_seconds": 0.016,
          "returncode": 0,
          "stderr": "",
          "stdout": "[\n    {\n        \"Id\": \"aa430e5ff01d2e1b794673348c933c151d4d805a23436c75a86dffb22023f97e\",\n        \"Created\": \"2026-09-09T15:18:41.059632805Z\",\n        \"Path\": \"docker-entrypoint.sh\",\n        \"Args\": [\n            \"postgres\",\n            \"-c\",\n            \"listen_addresses=*\",\n            \"-c\",\n            \"log_destination=csvlog\",\n            \"-c\",\n            \"logging_collector=on\",\n            \"-c\",\n            \"log_directory=log\",\n            \"-c\",\n            \"log_filename=postgresql-%Y%m%d%H%M%S.log\",\n            \"-c\",\n            \"log_min_messages=error\",\n            \"-c\",\n            \"log_min_error_statement=error\",\n            \"-c\",\n            \"log_error_verbosity=verbose\",\n            \"-c\",\n            \"wal_level=logical\",\n            \"-c\",\n            \"max_wal_senders=10\",\n            \"-c\",\n            \"max_replication_slots=10\"\n        ],\n        \"State\": {\n            \"Status\": \"running\",\n            \"Running\": true,\n            \"Paused\": false,\n            \"Restarting\": false,\n            \"OOMKilled\": false,\n            \"Dead\": false,\n            \"Pid\": 55888,\n            \"ExitCode\": 0,\n            \"Error\": \"\",\n            \"StartedAt\": \"2026-09-09T15:18:41.160417763Z\",\n            \"FinishedAt\": \"0001-01-01T00:00:00Z\"\n        },\n        \"Image\": \"sha256:b2baf8998630663d21370da06387c950e587071bdd307ee34e661cdcc7442bcc\",\n        \"ResolvConfPath\": \"/var/lib/docker/containers/aa430e5ff01d2e1b794673348c933c151d4d805a23436c75a86dffb22023f97e/resolv.conf\",\n        \"HostnamePath\": \"/var/lib/docker/containers/aa430e5ff01d2e1b794673348c933c151d4d805a23436c75a86dffb22023f97e/hostname\",\n        \"HostsPath\": \"/var/lib/docker/containers/aa430e5ff01d2e1b794673348c933c151d4d805a23436c75a86dffb22023f97e/hosts\",\n        \"LogPath\": \"/var/lib/docker/containers/aa430e5ff01d2e1b794673348c933c151d4d805a23436c75a86dffb22023f97e/aa430e5ff01d2e1b794673348c933c151d4d805a23436c75a86dffb22023f97e-json.log\",\n        \"Name\": \"/sqlstate28000_28000conncontractpg10_pg10\",\n        \"RestartCount\": 0,\n        \"Driver\": \"overlayfs\",\n        \"Platform\": \"linux\",\n        \"MountLabel\": \"\",\n        \"ProcessLabel\": \"\",\n        \"AppArmorProfile\": \"\",\n        \"ExecIDs\": null,\n        \"HostConfig\": {\n            \"Binds\": null,\n            \"ContainerIDFile\": \"\",\n            \"LogConfig\": {\n                \"Type\": \"json-file\",\n                \"Config\": {}\n            },\n            \"NetworkMode\": \"bridge\",\n            \"PortBindings\": {\n                \"5432/tcp\": [\n                    {\n                        \"HostIp\": \"127.0.0.1\",\n                        \"HostPort\": \"\"\n                    }\n                ]\n            },\n            \"RestartPolicy\": {\n                \"Name\": \"no\",\n                \"MaximumRetryCount\": 0\n            },\n            \"AutoRemove\": false,\n            \"VolumeDriver\": \"\",\n            \"VolumesFrom\": null,\n            \"ConsoleSize\": [\n                0,\n                0\n            ],\n            \"CapAdd\": null,\n            \"CapDrop\": null,\n            \"CgroupnsMode\": \"private\",\n            \"Dns\": null,\n            \"DnsOptions\": [],\n            \"DnsSearch\": [],\n            \"ExtraHosts\": null,\n            \"GroupAdd\": null,\n            \"IpcMode\": \"private\",\n            \"Cgroup\": \"\",\n            \"Links\": null,\n            \"OomScoreAdj\": 0,\n            \"PidMode\": \"\",\n            \"Privileged\": false,\n            \"PublishAllPorts\": false,\n            \"ReadonlyRootfs\": false,\n            \"SecurityOpt\": null,\n            \"UTSMode\": \"\",\n            \"UsernsMode\": \"\",\n            \"ShmSize\": 67108864,\n            \"Runtime\": \"runc\",\n            \"Isolation\": \"\",\n            \"CpuShares\": 0,\n            \"Memory\": 0,\n            \"NanoCpus\": 0,\n            \"CgroupParent\": \"\",\n            \"BlkioWeight\": 0,\n            \"BlkioWeightDevice\": [],\n            \"BlkioDeviceReadBps\": [],\n            \"BlkioDeviceWriteBps\": [],\n            \"BlkioDeviceReadIOps\": [],\n            \"BlkioDeviceWriteIOps\": [],\n            \"CpuPeriod\": 0,\n            \"CpuQuota\": 0,\n            \"CpuRealtimePeriod\": 0,\n            \"CpuRealtimeRuntime\": 0,\n            \"CpusetCpus\": \"\",\n            \"CpusetMems\": \"\",\n            \"Devices\": [],\n            \"DeviceCgroupRules\": null,\n            \"DeviceRequests\": null,\n            \"MemoryReservation\": 0,\n            \"MemorySwap\": 0,\n            \"MemorySwappiness\": null,\n            \"OomKillDisable\": null,\n            \"PidsLimit\": null,\n            \"Ulimits\": [],\n            \"CpuCount\": 0,\n            \"CpuPercent\": 0,\n            \"IOMaximumIOps\": 0,\n            \"IOMaximumBandwidth\": 0,\n            \"MaskedPaths\": [\n                \"/proc/acpi\",\n                \"/proc/asound\",\n                \"/proc/interrupts\",\n                \"/proc/kcore\",\n                \"/proc/keys\",\n                \"/proc/latency_stats\",\n                \"/proc/sched_debug\",\n                \"/proc/scsi\",\n                \"/proc/timer_list\",\n                \"/proc/timer_stats\",\n                \"/sys/devices/virtual/powercap\",\n                \"/sys/firmware\"\n            ],\n            \"ReadonlyPaths\": [\n                \"/proc/bus\",\n                \"/proc/fs\",\n                \"/proc/irq\",\n                \"/proc/sys\",\n                \"/proc/sysrq-trigger\"\n            ]\n        },\n        \"Storage\": {\n            \"RootFS\": {\n                \"Snapshot\": {\n                    \"Name\": \"overlayfs\"\n                }\n            }\n        },\n        \"Mounts\": [\n            {\n                \"Type\": \"volume\",\n                \"Name\": \"52ed878f656abb229c5bda9d6e70f0823722b3a9bdb946c68912b58e7972582d\",\n                \"Source\": \"/var/lib/docker/volumes/52ed878f656abb229c5bda9d6e70f0823722b3a9bdb946c68912b58e7972582d/_data\",\n                \"Destination\": \"/var/lib/postgresql/data\",\n                \"Driver\": \"local\",\n                \"Mode\": \"\",\n                \"RW\": true,\n                \"Propagation\": \"\"\n            }\n        ],\n        \"Config\": {\n            \"Hostname\": \"aa430e5ff01d\",\n            \"Domainname\": \"\",\n            \"User\": \"\",\n            \"AttachStdin\": false,\n            \"AttachStdout\": false,\n            \"AttachStderr\": false,\n            \"ExposedPorts\": {\n                \"5432/tcp\": {}\n            },\n            \"Tty\": false,\n            \"OpenStdin\": false,\n            \"StdinOnce\": false,\n            \"Env\": [\n                \"POSTGRES_HOST_AUTH_METHOD=trust\",\n                \"PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/lib/postgresql/10/bin\",\n                \"GOSU_VERSION=1.14\",\n                \"LANG=en_US.utf8\",\n                \"PG_MAJOR=10\",\n                \"PG_VERSION=10.21-1.pgdg90+1\",\n                \"PGDATA=/var/lib/postgresql/data\"\n            ],\n            \"Cmd\": [\n                \"postgres\",\n                \"-c\",\n                \"listen_addresses=*\",\n                \"-c\",\n                \"log_destination=csvlog\",\n                \"-c\",\n                \"logging_collector=on\",\n                \"-c\",\n                \"log_directory=log\",\n                \"-c\",\n                \"log_filename=postgresql-%Y%m%d%H%M%S.log\",\n                \"-c\",\n                \"log_min_messages=error\",\n                \"-c\",\n                \"log_min_error_statement=error\",\n                \"-c\",\n                \"log_error_verbosity=verbose\",\n                \"-c\",\n                \"wal_level=logical\",\n                \"-c\",\n                \"max_wal_senders=10\",\n                \"-c\",\n                \"max_replication_slots=10\"\n            ],\n            \"Image\": \"postgres@sha256:b2baf8998630663d21370da06387c950e587071bdd307ee34e661cdcc7442bcc\",\n            \"Volumes\": {\n                \"/var/lib/postgresql/data\": {}\n            },\n            \"WorkingDir\": \"\",\n            \"Entrypoint\": [\n                \"docker-entrypoint.sh\"\n            ],\n            \"Labels\": {},\n            \"StopSignal\": \"SIGINT\",\n            \"StopTimeout\": 1\n        },\n        \"NetworkSettings\": {\n            \"SandboxID\": \"6ad1c1780da682448a4a31261a60105621d397a0f6902f1b917072cc7ecf54d4\",\n            \"SandboxKey\": \"/var/run/docker/netns/6ad1c1780da6\",\n            \"Ports\": {\n                \"5432/tcp\": [\n                    {\n                        \"HostIp\": \"127.0.0.1\",\n                        \"HostPort\": \"60052\"\n                    }\n                ]\n            },\n            \"Networks\": {\n                \"bridge\": {\n                    \"IPAMConfig\": null,\n                    \"Links\": null,\n                    \"Aliases\": null,\n                    \"DriverOpts\": null,\n                    \"GwPriority\": 0,\n                    \"NetworkID\": \"aed51554f8cd8bac69ecd4f073e41e147fda7b458e9d95be2af472651f2e825c\",\n                    \"EndpointID\": \"ac018d4288c519a04bbcbb6c7cc99a7b6ffe0254915dc64f57b56777db9f4bc7\",\n                    \"Gateway\": \"172.17.0.1\",\n                    \"IPAddress\": \"172.17.0.53\",\n                    \"MacAddress\": \"96:d0:ac:e7:8c:a3\",\n                    \"IPPrefixLen\": 16,\n                    \"IPv6Gateway\": \"\",\n                    \"GlobalIPv6Address\": \"\",\n                    \"GlobalIPv6PrefixLen\": 0,\n                    \"DNSNames\": null\n                }\n            }\n        },\n        \"ImageManifestDescriptor\": {\n            \"mediaType\": \"application/vnd.docker.distribution.manifest.v2+json\",\n            \"digest\": \"sha256:52aada7978f1eef3b6b52a51afb7a3defd69254d00c946cb90d2ceb32b8ffce7\",\n            \"size\": 3246,\n            \"platform\": {\n                \"architecture\": \"arm64\",\n                \"os\": \"linux\",\n                \"variant\": \"v8\"\n            }\n        }\n    }\n]\n"
        }
      }
    },
    "environment": {
      "lc_messages": "en_US.utf8",
      "libpq_version": "18.6",
      "locale": "en_US.UTF-8",
      "log_destination": "csvlog",
      "machine": "arm64",
      "platform": "macOS-26.6.2-arm64-arm-64bit-Mach-O",
      "psycopg_version": "3.3.5",
      "python_version": "3.14.6 (main, Jun 10 2026, 10:03:53) [Clang 21.0.0 (clang-2100.0.123.102)]",
      "server_version": "10.21 (Debian 10.21-1.pgdg90+1)",
      "server_version_num": "100021",
      "target_kind": "pg10"
    },
    "id": "runtime.28000-conn-contract-pg10.pg10",
    "image": "postgres:10",
    "kind": "runtime_observation",
    "limits": "Disposable runner-owned target only; this is a bounded mechanism case, not a guarantee for every client or network path.",
    "observed": {
      "collector": {
        "primary": "role \"u28000_missing_25282cee130f\" does not exist",
        "severity": "FATAL",
        "sqlstate": "28000"
      },
      "diagnostic": {
        "column_name": null,
        "constraint_name": null,
        "context": null,
        "datatype_name": null,
        "exception_type": "OperationalError",
        "internal_position": null,
        "internal_query": null,
        "message_detail": null,
        "message_hint": null,
        "message_primary": null,
        "schema_name": null,
        "severity": null,
        "severity_nonlocalized": null,
        "source_file": null,
        "source_function": null,
        "source_line": null,
        "sqlstate": null,
        "statement_position": null,
        "table_name": null,
        "text": "connection failed: connection to server at \"127.0.0.1\", port 60052 failed: FATAL:  role \"u28000_missing_25282cee130f\" does not exist"
      },
      "failed_connection_has_no_transaction": true,
      "missing_role": "u28000_missing_25282cee130f",
      "probe": 1,
      "probe_status": "IDLE",
      "server_error": {
        "C": "28000",
        "F": "miscinit.c",
        "L": "518",
        "M": "role \"u28000_missing_25282cee130f\" does not exist",
        "R": "InitializeSessionUserId",
        "S": "FATAL",
        "V": "FATAL"
      }
    },
    "raw": "verify/results/28000-conn-contract-pg10/pg10/raw.jsonl",
    "raw_sha256": "7ffc6c2d3c25c491c36c39de6257045670980520cd1da2462a6adf124bc0abaa",
    "run_id": "28000-conn-contract-pg10",
    "server_version": "10.21 (Debian 10.21-1.pgdg90+1)",
    "server_version_num": 100021,
    "snippet_registry": {
      "path": "verify/cases/28000/snippets.json",
      "sha256": "30eca9ec77f1b393fb74d2c53a660a7e601da82c26919f453c6fb18bc418f43a"
    },
    "status": "passed",
    "summary": "verify/results/28000-conn-contract-pg10/pg10/summary.json",
    "summary_sha256": "3ae410746390cde17fa2d4c883361bbd6dc21726458c771ccabf0b32d01b14f8",
    "target": "pg10"
  },
  "run_id": "28000-conn-contract-pg10",
  "runtime_id": "runtime.28000-conn-contract-pg10.pg10",
  "server_version": "10.21 (Debian 10.21-1.pgdg90+1)",
  "status": "passed",
  "target": "pg10"
}
sources · src.errcodes.18.6
{
  "commit": "724edf9bde9d356724ad384a2e196edc3c9f80f7",
  "docs_url": "",
  "kind": "upstream_source",
  "location": "",
  "path": "src/backend/utils/errcodes.txt",
  "position": 0,
  "sha256": "6e8de346643ba84aa3c9c6a73360acfc7b2dfb89162c06c08ce9bf5bcd5bbcba",
  "source_id": "src.errcodes.18.6",
  "tag": "REL_18_6",
  "url": "https://github.com/postgres/postgres/blob/724edf9bde9d356724ad384a2e196edc3c9f80f7/src/backend/utils/errcodes.txt"
}
sources · src.calls.REL_18_6
{
  "commit": "",
  "docs_url": "",
  "kind": "local_artifact",
  "location": "",
  "path": "raw/calls/REL_18_6.jsonl",
  "position": 1,
  "sha256": "9ee8a0e81d8f0825c5c1ae45583439859a26e602bdd4ce2f2a62aa278867ccbf",
  "source_id": "src.calls.REL_18_6",
  "tag": "REL_18_6",
  "url": ""
}
sources · src.calls.REL_10_23
{
  "commit": "",
  "docs_url": "",
  "kind": "local_artifact",
  "location": "",
  "path": "raw/calls/REL_10_23.jsonl",
  "position": 2,
  "sha256": "00d16d3eb01b71ccf1b245c8f3102f9d0ec9f36fb02777b8dd1b99fcb263040c",
  "source_id": "src.calls.REL_10_23",
  "tag": "REL_10_23",
  "url": ""
}
sources · src.miscinit-missing-role.18.6
{
  "commit": "724edf9bde9d356724ad384a2e196edc3c9f80f7",
  "docs_url": "",
  "kind": "upstream_source",
  "location": "",
  "path": "src/backend/utils/init/miscinit.c",
  "position": 3,
  "sha256": "54bdb859c143a6c70d86067ccf2e124f59aa0852e5705bb653652e41a60af39a",
  "source_id": "src.miscinit-missing-role.18.6",
  "tag": "REL_18_6",
  "url": "https://github.com/postgres/postgres/blob/724edf9bde9d356724ad384a2e196edc3c9f80f7/src/backend/utils/init/miscinit.c#L802-L804"
}
sources · src.miscinit-missing-role.10.23
{
  "commit": "02991e79f8f58bc208f05dcc8af0c62dbe0a6ea4",
  "docs_url": "",
  "kind": "upstream_source",
  "location": "",
  "path": "src/backend/utils/init/miscinit.c",
  "position": 4,
  "sha256": "c4d2e234f96644d43aad9e9a6728df693e7f75175f05a550701413ceee70fb82",
  "source_id": "src.miscinit-missing-role.10.23",
  "tag": "REL_10_23",
  "url": "https://github.com/postgres/postgres/blob/02991e79f8f58bc208f05dcc8af0c62dbe0a6ea4/src/backend/utils/init/miscinit.c#L516-L518"
}
sources · manifest.28000
{
  "commit": "",
  "docs_url": "",
  "kind": "local_artifact",
  "location": "",
  "path": "verify/cases/28000/cases.json",
  "position": 5,
  "sha256": "188147e72a59764e242b45c406cccd69a56cd8101b210403ebf33cec273693cc",
  "source_id": "manifest.28000",
  "tag": "workspace",
  "url": "verify/cases/28000/cases.json"
}
sources · snippet-registry.28000
{
  "commit": "",
  "docs_url": "",
  "kind": "local_artifact",
  "location": "",
  "path": "verify/cases/28000/snippets.json",
  "position": 6,
  "sha256": "30eca9ec77f1b393fb74d2c53a660a7e601da82c26919f453c6fb18bc418f43a",
  "source_id": "snippet-registry.28000",
  "tag": "workspace",
  "url": "verify/cases/28000/snippets.json"
}

来源引用

完整定义与证据 JSON

定义来源

center · PostgreSQL 18 · english-manuals:a1e418fbcef0403e5100a522a964dd0b468237e1eb0935dffafc1a1b1926c8fb

正文语言: zh-Hans · english-manuals:a1e418fbcef0403e5100a522a964dd0b468237e1eb0935dffafc1a1b1926c8fb