md5_password_warnings
是一个 配置参数,用于决定在通过 CREATE ROLE
或 ALTER ROLE
命令加密密码时,是否会发出关于 MD5 密码使用的警告。
md5_password_warnings
在 PostgreSQL 18 中被添加。
默认值
md5_password_warnings
的默认值为:on
。
按 PostgreSQL 版本详细信息
md5_password_warnings (PostgreSQL 19)
设置 | 开启 |
单位 | |
类别 | 连接与认证 / 认证 |
简短描述 | 启用 MD5 密码的弃用警告。 |
扩展描述 | |
上下文 | user |
变量类型 | bool |
来源 | 默认 |
最小值 | |
最大值 | |
枚举值 | |
启动值 | 开启 |
重置值 | 开启 |
源文件 | |
源行 | |
需要重启 | false |
md5_password_warnings (PostgreSQL 18)
设置 | 开启 |
单位 | |
类别 | 连接与认证 / 认证 |
简短描述 | 启用 MD5 密码的弃用警告。 |
扩展描述 | |
上下文 | user |
变量类型 | bool |
来源 | 默认 |
最小值 | |
最大值 | |
枚举值 | |
启动值 | 开启 |
重置值 | 开启 |
源文件 | |
源行 | |
需要重启 | false |
变更历史
- PostgreSQL 18
- 已添加 (提交 db6a4a98)
示例
md5_password_warnings
的基本用法示例
postgres=# SHOW password_encryption; password_encryption --------------------- md5 (1 row) postgres=# ALTER ROLE foo PASSWORD 'bar'; 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. ALTER ROLE postgres=# SET md5_password_warnings TO off; SET postgres=# ALTER ROLE foo PASSWORD 'baz'; ALTER ROLE
参考资料
- PostgreSQL 文档: md5_password_warnings