目录
一、现象:
schema=# select uuid_generate_v1();
ERROR: function uuid_generate_v1() does not exist
第1行select uuid_generate_v1();
^
提示: No function matches the given name and argument types. You might need to add explicit type casts.
时间:14.543 ms
二、原因:
默认情况,postgres 是没有uuid_generate_v1方法的,需要安装扩展,并使其启用uuid-ossp才可以使用该方法。
三、解决方法:
1.安装uuid-ossp扩展依赖环境
可使用编译安装或Yum安装,因为我这里的环境是Postgres10,yum安装,因此优先选择yum安装扩展。
yum install -y postgresql10-contrib