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

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

Wiki / SQLSTATE

01006 — privilege_not_revoked

REVOKE 未撤销或未完全撤销权限的警告。

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

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

aliases
未知
class name
Warning
condition name
privilege_not_revoked
lang
en
sqlstate
01006

版本定义 PG 18

01006 — privilege_not_revoked

速览 {#at-a-glance}

PostgreSQL 18.6 在 src/backend/catalog/aclchk.c 的 REVOKE 路径确认发出 01006。它报告权限变化为空或不完整;命令可以完成,同时发送 warning。

含义 {#meaning}

确认的 18.6 实现是 ACL 命令中的 REVOKE 路径,区分没有撤销权限和没有完全撤销权限,并分别使用列级和对象级模板。

消息与诊断 {#messages}

18.6 固定路径的主消息模板为:no privileges could be revoked for column "%s" of relation "%s"、no privileges could be revoked for "%s"、not all privileges could be revoked for column "%s" of relation "%s"、not all privileges could be revoked for "%s"。确认组没有 detail 或 hint。

诊断 {#diagnosis}

记录目标是列还是对象,以及解析后的关系/对象名。在固定 aclchk.c 函数中,this_privileges 是请求权限集合与有效 grantor 可用 grant option 的交集。REVOKE warning 在该掩码为零时是 none,在 !all_privs 且掩码不同于请求时是 partial;这个 warning 分支不会检查 grantee 的旧 ACL。分别检查有效授权者、grant option、请求权限,再检查最终 ACL。WARNING 与会中止命令的 ERROR 不同。

处理 {#response}

将命令结果和 warning 分开处理。如果目标访问变化没有完成,修正角色、对象或权限并检查 ACL;不改变造成不匹配的条件而重复 REVOKE 可能得到同一 warning。

版本 {#versions}

01006 在锁定目录 9.0.23 至 18.6 以及 19 Beta 3 中存在,known_present_by 为 8.0.0。18.6 的固定 warning 路径确认当前消息,不表示所有历史版本措辞相同。

相关 {#related}

01007 是对应的未授予权限 warning;42501 是权限 error;01000 是警告类。

来源 {#sources}

  • errcodes.txt — 定义,SHA-256 6e8de346643ba84aa3c9c6a73360acfc7b2dfb89162c06c08ce9bf5bcd5bbcba.
  • aclchk.c — 固定路径,SHA-256 9700258318959b47c42edb423418fb511dd3a008023e732f601eecf4c80868f8。
  • 结构化证据 — 固定来源、消息和运行边界。

比较版本

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

claims · identity
{
  "claim_id": "identity",
  "limits": "",
  "method": "Read the fixed errcodes definition row and macro.",
  "position": 0,
  "runtime": [],
  "sources": [
    "src.errcodes.18.6"
  ],
  "statement": "01006 is privilege_not_revoked in SQLSTATE Class 01."
}
claims · source-path
{
  "claim_id": "source-path",
  "limits": "This confirms a source path and current wording; it is not a runtime observation of every installation.",
  "method": "Read the fixed source context around the SQLSTATE macro.",
  "position": 1,
  "runtime": [],
  "sources": [
    "src.aclchk.18.6"
  ],
  "statement": "A fixed PostgreSQL 18.6 source path uses this SQLSTATE at the stated severity and operation."
}
claims · acl-effective-grantor
{
  "claim_id": "acl-effective-grantor",
  "limits": "This is a source-level warning condition; it does not claim a natural runtime or prescribe a universal role/ACL setup.",
  "method": "Read restrict_and_check_grant() and its fixed {op} report branches around aclchk.c lines 318-382.",
  "position": 2,
  "runtime": [],
  "sources": [
    "src.aclchk.18.6"
  ],
  "statement": "The fixed aclchk.c function computes this_privileges as the requested privilege set intersected with the effective grantor's available grant options. The REVOKE none branch warns when that mask is zero; the partial branch warns when !all_privs and the mask differs from the request. This warning branch does not inspect the grantee's old ACL; the resulting ACL must be checked separately."
}
messages · acl-revoke-column-none
{
  "limits": "",
  "message_id": "acl-revoke-column-none",
  "path": "src.aclchk.18.6",
  "position": 0,
  "raw": {
    "id": "acl-revoke-column-none",
    "path": "src.aclchk.18.6",
    "primary_template": "no privileges could be revoked for column \"%s\" of relation \"%s\"",
    "severity": "WARNING",
    "source_ids": [
      "src.aclchk.18.6"
    ],
    "sources": [
      "src.aclchk.18.6"
    ],
    "sqlstate": "01006"
  },
  "severity": "WARNING",
  "sources": [
    "src.aclchk.18.6"
  ],
  "templates": [
    {
      "kind": "primary",
      "literal": "no privileges could be revoked for column \" \" of relation \" \"",
      "position": 0,
      "role": "",
      "template": "no privileges could be revoked for column \"%s\" of relation \"%s\""
    }
  ]
}
messages · acl-revoke-object-none
{
  "limits": "",
  "message_id": "acl-revoke-object-none",
  "path": "src.aclchk.18.6",
  "position": 1,
  "raw": {
    "id": "acl-revoke-object-none",
    "path": "src.aclchk.18.6",
    "primary_template": "no privileges could be revoked for \"%s\"",
    "severity": "WARNING",
    "source_ids": [
      "src.aclchk.18.6"
    ],
    "sources": [
      "src.aclchk.18.6"
    ],
    "sqlstate": "01006"
  },
  "severity": "WARNING",
  "sources": [
    "src.aclchk.18.6"
  ],
  "templates": [
    {
      "kind": "primary",
      "literal": "no privileges could be revoked for \" \"",
      "position": 0,
      "role": "",
      "template": "no privileges could be revoked for \"%s\""
    }
  ]
}
messages · acl-revoke-column-partial
{
  "limits": "",
  "message_id": "acl-revoke-column-partial",
  "path": "src.aclchk.18.6",
  "position": 2,
  "raw": {
    "id": "acl-revoke-column-partial",
    "path": "src.aclchk.18.6",
    "primary_template": "not all privileges could be revoked for column \"%s\" of relation \"%s\"",
    "severity": "WARNING",
    "source_ids": [
      "src.aclchk.18.6"
    ],
    "sources": [
      "src.aclchk.18.6"
    ],
    "sqlstate": "01006"
  },
  "severity": "WARNING",
  "sources": [
    "src.aclchk.18.6"
  ],
  "templates": [
    {
      "kind": "primary",
      "literal": "not all privileges could be revoked for column \" \" of relation \" \"",
      "position": 0,
      "role": "",
      "template": "not all privileges could be revoked for column \"%s\" of relation \"%s\""
    }
  ]
}
messages · acl-revoke-object-partial
{
  "limits": "",
  "message_id": "acl-revoke-object-partial",
  "path": "src.aclchk.18.6",
  "position": 3,
  "raw": {
    "id": "acl-revoke-object-partial",
    "path": "src.aclchk.18.6",
    "primary_template": "not all privileges could be revoked for \"%s\"",
    "severity": "WARNING",
    "source_ids": [
      "src.aclchk.18.6"
    ],
    "sources": [
      "src.aclchk.18.6"
    ],
    "sqlstate": "01006"
  },
  "severity": "WARNING",
  "sources": [
    "src.aclchk.18.6"
  ],
  "templates": [
    {
      "kind": "primary",
      "literal": "not all privileges could be revoked for \" \"",
      "position": 0,
      "role": "",
      "template": "not all privileges could be revoked for \"%s\""
    }
  ]
}
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.aclchk.18.6
{
  "commit": "724edf9bde9d356724ad384a2e196edc3c9f80f7",
  "docs_url": "",
  "kind": "upstream_source",
  "location": "",
  "path": "src/backend/catalog/aclchk.c",
  "position": 1,
  "sha256": "9700258318959b47c42edb423418fb511dd3a008023e732f601eecf4c80868f8",
  "source_id": "src.aclchk.18.6",
  "tag": "REL_18_6",
  "url": "https://github.com/postgres/postgres/blob/724edf9bde9d356724ad384a2e196edc3c9f80f7/src/backend/catalog/aclchk.c#L318-L382"
}
sources · src.calls.REL_18_6
{
  "commit": "",
  "docs_url": "",
  "kind": "local_artifact",
  "location": "",
  "path": "raw/calls/REL_18_6.jsonl",
  "position": 2,
  "sha256": "9ee8a0e81d8f0825c5c1ae45583439859a26e602bdd4ce2f2a62aa278867ccbf",
  "source_id": "src.calls.REL_18_6",
  "tag": "",
  "url": ""
}

来源引用

完整定义与证据 JSON

定义来源

center · PostgreSQL 18 · english-manuals:591145c7a17d157b98c24901bc6900d364555693f4fe6c39933ecf0ff7e1d261

正文语言: zh-Hans · english-manuals:591145c7a17d157b98c24901bc6900d364555693f4fe6c39933ecf0ff7e1d261