postgresql - 即使启用了 pgcrypto 扩展,AWS RDS Postgres Crypto 函数也不起作用
问题描述
我有新的 AWS RDS Postgres (v 11) 实例。我已经安装了pgcrypto
扩展程序,但它不允许再次这样做:
CREATE EXTENSION pgcrypto;
Error in query (7): ERROR: extension "pgcrypto" already exists
但我不能使用扩展功能:
select gen_salt('bf');
Error in query (7): ERROR: function gen_salt(unknown) does not exist
LINE 1: select gen_salt('bf')
HINT: No function matches the given name and argument types. You might need to add explicit type casts.
我做错了什么?
解决方案
问题是扩展可能是在模式处于活动状态时添加的。感谢@Antti Haapala 提供指向同一问题的链接:https ://dba.stackexchange.com/questions/135093/in-rds-digest-function-is-undefined-after-creating-pgcrypto-extension 。
当没有选择架构时,我做了以下操作:
DROP EXTENSION pgcrypto;
Query executed OK, 0 rows affected. (0.031 s)
CREATE EXTENSION pgcrypto;
Query executed OK, 0 rows affected. (0.046 s)
SELECT gen_salt('bf');
gen_salt
$2a$06$kyj11fcRtpwxrqgCfZEIaO
现在一切正常。
推荐阅读
- php - 如何将布尔值从 Blade 传递到 Vue 组件 Laravel 7?
- javascript - 如何在特定条件下触发通知?
- javascript - 实现放大缩小和拖动能够JQuery
- python-3.x - 添加天数以输入
- analytics - 哪些数据库对用户分析有好处
- javascript - NodeJS 12 SyntaxError:意外的令牌“导出”
- reactjs - 在 useEffect 中,调用更新时是否会更新所有变量?
- rust - 尝试将盒装 dyn 特征传递给函数时出现“借来的值不够长”的错误
- node.js - 尝试创建 Ubuntu 快照时 OPC UA 客户端出现问题
- firebase - 将 google-services.json 文件放在 expo 项目中的什么位置?