【问题标题】:AWS RDS Postgres Crypto functions doesn't work even with the pgcrypto extension enabled即使启用了 pgcrypto 扩展,AWS RDS Postgres Crypto 函数也不起作用
【发布时间】:2019-05-26 07:06:25
【问题描述】:

我有新的 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.

我做错了什么?

【问题讨论】:

标签: postgresql amazon-web-services amazon-rds pgcrypto


【解决方案1】:

问题在于,扩展可能是在架构处于活动状态时添加的。感谢@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

现在一切正常。

【讨论】:

    猜你喜欢
    • 2020-04-17
    • 2011-10-30
    • 1970-01-01
    • 2023-03-14
    • 1970-01-01
    • 2017-11-18
    • 2017-10-01
    相关资源
    最近更新 更多