postgresql中uuid的使用

1.安装扩展插件

复制代码
create extension "pgcrypto";

2.查询uuid

复制代码
#36位uuid
select gen_random_uuid();

#去除斜杠
select REPLACE(gen_random_uuid()::text, '-', '') 

3.uuid在字段默认值上的使用

注:在函数前,需要加上模式名称

相关推荐
l1t7 小时前
DeepSeek总结的DuckLake 入门
数据库
Joseph Cooper7 小时前
RAG 与 AI Agent:智能体真的需要检索增强生成吗?
数据库·人工智能·ai·agent·rag·上下文工程
light blue bird7 小时前
主子端台二分法任务汇总组件
前端·数据库·.net·桌面端winform
DevilSeagull8 小时前
MySQL(2) 客户端工具和建库
开发语言·数据库·后端·mysql·服务
小李来了!8 小时前
Navicate/plsql连接Oracle数据库教程
数据库·oracle
苍煜8 小时前
慢SQL优化实战教学
java·数据库·sql
zhaoyong2229 小时前
MySQL 存储过程中字符集与排序规则不匹配导致查询性能下降的解决方案
jvm·数据库·python
sinat_383437369 小时前
golang如何从Python转型Go开发_golang从Python转型Go开发攻略
jvm·数据库·python
远洪9 小时前
claude code 国内安装使用
数据库·mysql
雨辰AI9 小时前
SpringBoot3 + 人大金仓 V9 微服务监控实战|Prometheus+Grafana+SkyWalking 全链路监控
数据库·后端·微服务·grafana·prometheus·skywalking