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

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

文档 / SQL 状态码 / Class 01 警告

01P01 deprecated_feature

WARNING 源码确认 参考 未实测

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

版本覆盖

速览

PostgreSQL 18.6 在设置密码的操作产生或保留 MD5 verifier 时以 WARNING 发出 01P01。这是仍可继续的命令上的弃用通知,不是所有旧功能的通用失败码。

含义

确认的 18.6 实现是 src/backend/libpq/crypt.c 的设置密码路径,在最终 verifier 为 MD5 时发出 warning。触发依据是最终存储的 verifier 形式,例如 password_encryption = 'md5' 下的明文输入,或作为输入传入已有的 md5... verifier;它不是 pg_hba.conf 的认证方法,已有 SCRAM verifier 本身也不会触发此 warning。

消息与诊断

固定路径主消息为 setting an MD5-encrypted password;detail 为 MD5 password support is deprecated and will be removed in a future release of PostgreSQL.;hint 为 Refer to the PostgreSQL documentation for details about migrating to another password type.

报文模板

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

主消息 setting an MD5-encrypted password
DETAIL MD5 password support is deprecated and will be removed in a future release of PostgreSQL.
HINT Refer to the PostgreSQL documentation for details about migrating to another password type.

来源:src/backend/libpq/crypt.c @ REL_18_6

诊断

检查设置密码会话中的 SHOW password_encryption、输入是明文还是已有的 md5... verifier,并在有权限时检查角色最终 verifier。保留完整 warning,因为 detail 和 hint 指出了受影响的方法及迁移方向。不要把 pg_hba.conf 的认证方法当成触发条件,也不要把已有 SCRAM verifier 推断为此 warning 的原因。

处理

按官方密码认证文档将受影响角色迁移到 SCRAM;对于明文输入,先将 password_encryption 设为 scram-sha-256,再重置密码,并验证客户端兼容性。不要把旧 MD5 verifier 原样作为迁移步骤。warning 本身不要求原样重试设置密码命令。

版本

01P01 在锁定目录 9.0.23 至 18.6 以及 19 Beta 3 中存在,known_present_by 为 8.0.0。固定的 MD5 路径和措辞仅确认 18.6;其他弃用功能或旧措辞需要独立来源。

来源

证据

断言

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

  • 01P01 is deprecated_feature 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/libpq/crypt.c

  • The fixed password-setting path is relevant when the resulting stored verifier is MD5; diagnose password_encryption and the supplied verifier form, and do not treat pg_hba.conf authentication method or an existing SCRAM verifier as this warning trigger.

    核实方式Read the fixed crypt.c warning call site and its password-setting context.

    不覆盖Source evidence confirms the warning call site and exact fields; no natural password-setting runtime is claimed.

    来源src/backend/libpq/crypt.c

同类 SQL 状态码

状态码 条件名 宏名称 严重等级 版本
Class 01 警告 Warning 8 个
01000 warning ERRCODE_WARNING WARNING 7.4
类别 01 的通用警告,需结合实际严重级别判断。 活跃
01003 null_value_eliminated_in_set_function ERRCODE_WARNING_NULL_VALUE_ELIMINATED_IN_SET_FUNCTION WARNING 7.4
集合函数计算时消除了 NULL 值的警告。 活跃
01004 string_data_right_truncation ERRCODE_WARNING_STRING_DATA_RIGHT_TRUNCATION WARNING 7.4
字符串数据被右截断的警告条件。 活跃
01006 privilege_not_revoked ERRCODE_WARNING_PRIVILEGE_NOT_REVOKED WARNING 8.0
REVOKE 未撤销或未完全撤销权限的警告。 活跃
01007 privilege_not_granted ERRCODE_WARNING_PRIVILEGE_NOT_GRANTED WARNING 8.0
GRANT 未授予或未完全授予权限的警告。 活跃
01008 implicit_zero_bit_padding ERRCODE_WARNING_IMPLICIT_ZERO_BIT_PADDING WARNING 7.4
位串被隐式补零填充的警告条件。 活跃
0100C dynamic_result_sets_returned ERRCODE_WARNING_DYNAMIC_RESULT_SETS_RETURNED WARNING 7.4
过程返回了动态结果集的警告条件。 活跃
01P01 deprecated_feature ERRCODE_WARNING_DEPRECATED_FEATURE WARNING 8.0
使用已弃用功能的警告,如 MD5 密码。 活跃