postgresql - PostgreSQL 无法生成 uuid 但安装了 uuid-ossp 扩展?
问题描述
postgresql11-server-11.8_2
当我尝试在 idempiere 中添加新客户端时,我收到以下错误消息:
idempiere Version=7.1.0.202008290007
Initial Client Setup Process
Do you want to start the Process?
** org.postgresql.util.PSQLException: ERROR: function uuid_generate_v4() does not exist Hint: No function matches the given name and argument types. You might need to add explicit type casts. Where: PL/pgSQL function generate_uuid() line 3 at RETURN
这通常表明数据库中缺少 uuid 扩展名。但这种情况并非如此。
[root@accounting-2 ~ (master)]# sudo -u postgres psql --dbname=idempiere
psql (11.8)
Type "help" for help.
idempiere=# \dx
List of installed extensions
Name | Version | Schema | Description
-----------+---------+------------+-------------------------------------------------
plpgsql | 1.0 | pg_catalog | PL/pgSQL procedural language
uuid-ossp | 1.1 | public | generate universally unique identifiers (UUIDs)
这是什么原因造成的?它是如何固定的?
解决方案
我的 postgres 中 \dx 的输出如下所示:
plpgsql | 1.0 | pg_catalog | PL/pgSQL procedural language
uuid-ossp | 1.1 | adempiere | generate universally unique identifiers (UUIDs)
在您的情况下,它显示 uuid-ossp 安装在公共模式中,而在我的情况下安装在 adempiere 模式中。
请在您的 idempiere 数据库中尝试以下命令:
CREATE EXTENSION "uuid-ossp"
推荐阅读
- macos - 在 Mac vim 上,如何将光标更改为闪烁块?
- ios - UIViewControllerAnimatedTransitioning 在进出视图动画时显示黑屏
- javascript - 加载(刷新)页面后如何在 Dropzone 中显示之前上传的文件如何在图片中显示?
- java - 在java中设置为构造函数参数
- python - 在 Django 中自动更改值
- excel - 使用多个列中的多个 OR 标准评估计数总和
- html - 如果图像不可用,HTML 如何发布 null 或测试说“找不到图像”
- api - 队列 PNR 返回“NO PNR IN AAA”(QueuePlaceLLSRQ)
- json - 如何使用下面的类动态地从 Web 服务读取下面给出的 JSON 数据,并希望创建接收到的数据的水平列表视图
- python - 使用 Tensorboard 绘制自定义数据