选择 打开 改范围 完整检索页

pgsql.cc 提供对 postgresql.org 官网内容的中文翻译,由 Pigsty 团队维护。

百科 / 错误代码 / Class 01 警告

01006 privilege_not_revoked

WARNING 源码确认 参考 未实测

类别
Class 01 警告
严重等级
WARNING
条件名
privilege_not_revoked
宏名称
ERRCODE_WARNING_PRIVILEGE_NOT_REVOKED
启用版本
8.0
状态
活跃

版本覆盖

速览

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

含义

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

消息与诊断

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。

报文模板

源码里的格式串,不是某一次运行的输出。%s 之类是占位符,实际报文会填入对象名与取值。适用范围一栏是核验时留下的原始英文记录,未经翻译。

主消息 no privileges could be revoked for column "%s" of relation "%s"

来源:src/backend/catalog/aclchk.c @ REL_18_6

主消息 no privileges could be revoked for "%s"

来源:src/backend/catalog/aclchk.c @ REL_18_6

主消息 not all privileges could be revoked for column "%s" of relation "%s"

来源:src/backend/catalog/aclchk.c @ REL_18_6

主消息 not all privileges could be revoked for "%s"

来源:src/backend/catalog/aclchk.c @ REL_18_6

诊断

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

处理

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

版本

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

来源

证据

断言

每条断言都写明了是怎么核实的,以及它不覆盖什么。这一层是核验时留下的原始英文记录,照原样呈现,未经翻译。

  • 01006 is privilege_not_revoked in SQLSTATE Class 01.

    核实方式Read the fixed errcodes definition row and macro.

    来源src/backend/utils/errcodes.txt

  • A fixed PostgreSQL 18.6 source path uses this SQLSTATE at the stated severity and operation.

    核实方式Read the fixed source context around the SQLSTATE macro.

    不覆盖This confirms a source path and current wording; it is not a runtime observation of every installation.

    来源src/backend/catalog/aclchk.c

  • 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.

    核实方式Read restrict_and_check_grant() and its fixed {op} report branches around aclchk.c lines 318-382.

    不覆盖This is a source-level warning condition; it does not claim a natural runtime or prescribe a universal role/ACL setup.

    来源src/backend/catalog/aclchk.c

同类错误代码

Class 01 警告 下的其他成员。