【问题标题】:HMAC postgres error - No function matches the given name and argument typesHMAC postgres 错误 - 没有函数与给定的名称和参数类型匹配
【发布时间】:2018-03-14 07:04:45
【问题描述】:

在 postgres 中使用 hmac 方法时出现以下错误。请帮忙。

root@go=# SELECT HMAC('MyPassword','mykey','md5');
ERROR:  42883: function hmac(unknown, unknown, unknown) does not exist
LINE 1: SELECT HMAC('MyPassword','mykey','md5');
               ^
HINT:  No function matches the given name and argument types. You might need to add explicit type casts.
LOCATION:  ParseFuncOrColumn, parse_func.c:523
Time: 0.703 ms

【问题讨论】:

  • 你是如何加载pgcrypto的?

标签: postgresql pgcrypto


【解决方案1】:

两种可能:

  1. 您从未使用CREATE EXTENSION 安装pgcrypto。

  2. 您在数据库用户 rootsearch_path 之外的架构中安装了 pgcrypto。

【讨论】:

  • 谢谢@Laurenz,我已经添加了扩展,它可以工作。 CREATE EXTENSION IF NOT EXISTS "pgcrypto" SCHEMA public;
猜你喜欢
  • 2013-08-20
  • 2018-02-25
  • 2016-07-07
  • 2014-09-05
  • 1970-01-01
  • 2021-02-13
  • 2013-01-20
  • 1970-01-01
相关资源
最近更新 更多