当前位置:网站首页>postgres uuid_generate_v1() does not exist
postgres uuid_generate_v1() does not exist
2022-04-21 06:26:00 【山水牧羊】
目录
一、现象:
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
2.启用uuid-ossp扩展
postgres=# create extension "uuid-ossp" ;
CREATE EXTENSION
3.验证
postgres-# \dx
已安装扩展列表
名称 | 版本 | 架构模式 | 描述
-----------+------+------------+-------------------------------------------------
plpgsql | 1.0 | pg_catalog | PL/pgSQL procedural language
uuid-ossp | 1.1 | public | generate universally unique identifiers (UUIDs)
更详细内容
postgres=# \dx+
对象用于扩展 "plpgsql"
对象描述
---------------------------------------
函数 plpgsql_call_handler()
函数 plpgsql_inline_handler(internal)
函数 plpgsql_validator(oid)
语言 plpgsql
(4 行记录)
对象用于扩展 "uuid-ossp"
对象描述
----------------------------------
函数 uuid_generate_v1()
函数 uuid_generate_v1mc()
函数 uuid_generate_v3(uuid,text)
函数 uuid_generate_v4()
函数 uuid_generate_v5(uuid,text)
函数 uuid_nil()
函数 uuid_ns_dns()
函数 uuid_ns_oid()
函数 uuid_ns_url()
函数 uuid_ns_x500()
(10 行记录)
再次执行
postgres=# select uuid_generate_v1();
uuid_generate_v1
--------------------------------------
9ffd8cc8-db44-11eb-8952-0050568a41b8
(1 行记录)
版权声明
本文为[山水牧羊]所创,转载请带上原文链接,感谢
https://blog.csdn.net/yeqiyugood/article/details/118424543
边栏推荐
- pg 数据库不能使用 zh_CN.UTF-8:initdb: error: locale “zh_CN.UTF-8“ requires unsupported encoding “GBK“
- Implémenter un tableau en tant que fonction JS. Prototype. Foreach (),. Map (),. Filtre ()
- Substring Inversion (Easy Version)
- P1018 乘积最大题解
- 图形学基础|皮肤渲染
- 2020牛客暑期多校训练营第二场 I Interval题解
- 好用的数据集和开源网络对比网站
- MySQL workbench cannot use clear text authentication over non SSL connections problem solving
- 一次从 EXSI 移植 vmfstools 失败的过程记录
- WordPress插件-Easy WP SMTP
猜你喜欢

【保姆安装教程】Linux操作系统中源码下载MySQL5.7

Reflection cannot find the class message classnotfound of UDF when executing flinksql code

记一次mySQL慢sql优化

Build your own blog

C语言版:二叉树的前序,中序,后序非递归遍历实现

图形学基础|基于LTC的面光源渲染

applicationContext. How to solve the problem of XML becoming gray document

Could not initialize cudnn ,please check cudnn installation.

Remember a MySQL slow SQL optimization

2020牛客暑期多校训练营第二场 I Interval题解
随机推荐
dpdk-16.04 监听 uio 文件检测中断的示例 demo 与内部实现解析
如何防止SQL注入
力扣-354.俄罗斯套娃信封问题
用JS函數形式實現一個Array.prototype.forEach(),.map(),.filter()
CF6D Lizards and Basements 2题解
Reflection cannot find the class message classnotfound of UDF when executing flinksql code
平面半交板子
D. Optimal Partition 线段树优化dp
WordPress插件-WP Mail SMTP
数据异构方案
D. 388535
从 systemd-udevd 运行 log 中研究其自动加载内核模块的过程
【LeetCode 228】汇总区间
There is no prompt for importing JSTL tag library URI
Semantic feature extraction and simple word frequency display (wordcloud)
Format checking tool eslint
C语言版:二叉树的前序,中序,后序非递归遍历实现
Solve the problem that the replacement traverses the circular call, resulting in the subsequent replacement replacing the data of the previous replacement
云计算中存储继承知识
P1018 乘积最大题解