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

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

Wiki / SQLSTATE

0L000 — 授权者无效(invalid_grantor)

授权者无效,见于旧 ACL 文本缺少 grantor。

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

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

aliases
未知
class name
Invalid Grantor
condition name
invalid_grantor
lang
en
sqlstate
0L000

版本定义 PG 18

0L000 — 授权者无效

速览 {#at-a-glance}

SQLSTATE 0L000 是 Class 0L 中的 invalid_grantor。固定的 aclparse 路径把它用于旧 ACL item 文本省略 /grantor 后缀时的向后兼容警告,并将授权者回退为 BOOTSTRAP_SUPERUSERID。这是 ACL 文本解析路径,不是 bootstrap 或 ACL 初始化阶段,也不是普通“权限不足”或无效 GRANT 操作路径。

含义 {#meaning}

0L000 是 invalid_grantor。在 aclparse 中,ACL item 没有 /grantor 后缀时会走向后兼容回退:解析器把授权者设为 BOOTSTRAP_SUPERUSERID,并发出带 SQLSTATE 0L000 的 WARNING。它可以发生在普通 ACL 文本解析过程中,并不表示 bootstrap 初始化。若有斜线却没有后续名称,同一解析器会改为以 22P02 和 a name must follow the "/" sign 报错。

诊断 {#diagnosis}

出现此警告时,检查正在解析的 ACL 文本以及是否含有授权者后缀。缺少斜线与斜线后为空是不同输入:前者走 0L000 兼容警告,后者走 22P02。普通 GRANT 应根据具体对象或权限报错诊断,例如 0LP01 或 42501。

处理 {#response}

如果文本由本方控制,应补写有效授权者并复核最终 ACL。不要把该警告当成 bootstrap 初始化失败的证据。本页只记录源码路径,没有选择自然 SQL 的 0L000 触发案例。

报文 {#messages}

固定的省略授权者分支以 WARNING 和 0L000 发出主报文 defaulting grantor to user ID %u,用户 ID 是动态值。相邻的斜线后无名称分支以 ERROR 和 22P02 发出主报文 a name must follow the "/" sign。只有客户端异常而没有服务器诊断时,不能据此认定 0L000。

代表案例 {#case}

本页没有选定的自然 SQL 运行。结构化证据记录的是源码或定义边界;客户端 RAISE 不能代表服务器机制。

版本 {#versions}

上面的生成事实表记录锁定的目录快照和最早观察到的定义。本页没有选定的自然 SQL 运行;固定 REL_18_6/REL_10_23 的 aclparse 源码比较不能当作实测结果,也不能据此推断所有中间版本的行为。

相关 {#related}

来源 {#sources}

  • src.aclparse-grantor-fallback.18.6 — src/backend/utils/adt/acl.c at REL_18_6 commit 724edf9bde9d356724ad384a2e196edc3c9f80f7; fixed blob SHA-256 623f2dd01c1d393d3b224c7622dc2ec946faced444c1f5fd5e396e037903a5b0 (source). 这是 aclparse 省略授权者的兼容分支。
  • src.aclparse-grantor-fallback.10.23 — src/backend/utils/adt/acl.c at REL_10_23 commit 02991e79f8f58bc208f05dcc8af0c62dbe0a6ea4; fixed blob SHA-256 3cfe29c06d211130552d2aab88f61dcdd9a5287c9ab8c450d48562056b32829e (source). 这是 aclparse 省略授权者的兼容分支。
  • src.aclparse-slash-missing-name.10.23 — 同一固定 acl.c 文件的 338–344 行记录 / 后没有名称时的独立 22P02 分支(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 · source_boundary
{
  "assertions": [],
  "case_id": "source_boundary",
  "cleanup": "Drop the case schema with an owner connection.",
  "has_snippet": false,
  "position": 0,
  "preconditions": [
    "A runner-owned disposable target is provisioned only if a source-boundary smoke run is requested."
  ],
  "repair": "Use the concrete source path or component-specific documentation when it applies.",
  "trigger": "No artificial SQL trigger is executed; this record preserves the fixed source/definition boundary.",
  "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": "0L000 is the invalid_grantor condition in Class 0L."
}
claims · mechanism.source-boundary
{
  "claim_id": "mechanism.source-boundary",
  "limits": "This is a bounded source claim; no natural SQLSTATE case was selected, and the warning's numeric user ID is dynamic.",
  "method": "Read the complete fixed aclparse branch in REL_18_6 and REL_10_23, including the slash-without-name error branch and the omitted-grantor fallback.",
  "position": 1,
  "runtime": [],
  "sources": [
    "src.aclparse-grantor-fallback.18.6",
    "src.aclparse-grantor-fallback.10.23",
    "src.aclparse-slash-missing-name.10.23"
  ],
  "statement": "The fixed aclparse path accepts ACL item text without a /grantor suffix for backward compatibility, defaults the grantor to BOOTSTRAP_SUPERUSERID, and emits WARNING 0L000. If a slash is present but no name follows it, the parser instead emits 22P02; this is ACL text parsing rather than bootstrap or ACL initialization and is not an ordinary GRANT failure."
}
claims · versions.catalogue-boundary
{
  "claim_id": "versions.catalogue-boundary",
  "limits": "Presence in a definition file is not an exact behavioral introduction, and the fixed source paths do not prove every intermediate release.",
  "method": "Read the generated facts block and fixed aclparse source records; no runtime result is used for this source-only page.",
  "position": 2,
  "runtime": [],
  "sources": [
    "src.errcodes.18.6",
    "src.aclparse-grantor-fallback.18.6",
    "src.aclparse-grantor-fallback.10.23"
  ],
  "statement": "The locked catalogue records 0L000 in the listed snapshots; this page compares only the fixed REL_18_6 and REL_10_23 aclparse source paths and has no selected natural runtime."
}
messages · message.aclparse-grantor-fallback
{
  "limits": "The %u value is BOOTSTRAP_SUPERUSERID in the fixed fallback branch; this message is emitted for ACL text without a /grantor suffix.",
  "message_id": "message.aclparse-grantor-fallback",
  "path": "",
  "position": 0,
  "raw": {
    "id": "message.aclparse-grantor-fallback",
    "limits": "The %u value is BOOTSTRAP_SUPERUSERID in the fixed fallback branch; this message is emitted for ACL text without a /grantor suffix.",
    "primary_template": "defaulting grantor to user ID %u",
    "severity_source": "explicit WARNING",
    "sources": [
      "src.aclparse-grantor-fallback.18.6",
      "src.aclparse-grantor-fallback.10.23"
    ],
    "sqlstate": "0L000"
  },
  "severity": "explicit WARNING",
  "sources": [
    "src.aclparse-grantor-fallback.18.6",
    "src.aclparse-grantor-fallback.10.23"
  ],
  "templates": [
    {
      "kind": "primary",
      "literal": "defaulting grantor to user ID",
      "position": 0,
      "role": "",
      "template": "defaulting grantor to user ID %u"
    }
  ]
}
messages · message.aclparse-slash-missing-name
{
  "limits": "",
  "message_id": "message.aclparse-slash-missing-name",
  "path": "",
  "position": 1,
  "raw": {
    "id": "message.aclparse-slash-missing-name",
    "primary_template": "a name must follow the \"/\" sign",
    "severity_source": "explicit ERROR",
    "sources": [
      "src.aclparse-slash-missing-name.10.23"
    ],
    "sqlstate": "22P02"
  },
  "severity": "explicit ERROR",
  "sources": [
    "src.aclparse-slash-missing-name.10.23"
  ],
  "templates": [
    {
      "kind": "primary",
      "literal": "a name must follow the \"/\" sign",
      "position": 0,
      "role": "",
      "template": "a name must follow the \"/\" sign"
    }
  ]
}
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.aclparse-grantor-fallback.18.6
{
  "commit": "724edf9bde9d356724ad384a2e196edc3c9f80f7",
  "docs_url": "",
  "kind": "upstream_source",
  "location": "",
  "path": "src/backend/utils/adt/acl.c",
  "position": 3,
  "sha256": "623f2dd01c1d393d3b224c7622dc2ec946faced444c1f5fd5e396e037903a5b0",
  "source_id": "src.aclparse-grantor-fallback.18.6",
  "tag": "REL_18_6",
  "url": "https://github.com/postgres/postgres/blob/724edf9bde9d356724ad384a2e196edc3c9f80f7/src/backend/utils/adt/acl.c#L408-L411"
}
sources · src.aclparse-grantor-fallback.10.23
{
  "commit": "02991e79f8f58bc208f05dcc8af0c62dbe0a6ea4",
  "docs_url": "",
  "kind": "upstream_source",
  "location": "",
  "path": "src/backend/utils/adt/acl.c",
  "position": 4,
  "sha256": "3cfe29c06d211130552d2aab88f61dcdd9a5287c9ab8c450d48562056b32829e",
  "source_id": "src.aclparse-grantor-fallback.10.23",
  "tag": "REL_10_23",
  "url": "https://github.com/postgres/postgres/blob/02991e79f8f58bc208f05dcc8af0c62dbe0a6ea4/src/backend/utils/adt/acl.c#L350-L353"
}
sources · src.aclparse-slash-missing-name.10.23
{
  "commit": "02991e79f8f58bc208f05dcc8af0c62dbe0a6ea4",
  "docs_url": "",
  "kind": "upstream_source",
  "location": "",
  "path": "src/backend/utils/adt/acl.c",
  "position": 5,
  "sha256": "3cfe29c06d211130552d2aab88f61dcdd9a5287c9ab8c450d48562056b32829e",
  "source_id": "src.aclparse-slash-missing-name.10.23",
  "tag": "REL_10_23",
  "url": "https://github.com/postgres/postgres/blob/02991e79f8f58bc208f05dcc8af0c62dbe0a6ea4/src/backend/utils/adt/acl.c#L338-L344"
}
sources · manifest.0L000
{
  "commit": "",
  "docs_url": "",
  "kind": "local_artifact",
  "location": "",
  "path": "verify/cases/0L000/cases.json",
  "position": 6,
  "sha256": "1c88601f15fe25f7ae25c1da2379a28f1f4508e15e5124eb66c6a9291d05cfcb",
  "source_id": "manifest.0L000",
  "tag": "workspace",
  "url": "verify/cases/0L000/cases.json"
}

来源引用

完整定义与证据 JSON

定义来源

center · PostgreSQL 18 · english-manuals:f03008aefdff0b606794420b0e00c98c863e55143667d8e1e98c2ac47708f5ee

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