PostgreSQL UUID 函数
来源:互联网 发布:自然语言处理 知乎 编辑:程序博客网 时间:2024/05/20 08:00
http://chenxiaoyu.org/blog/archives/209
测试环境:PostgreSQL 8.4
默认PostgreSQL是木有UUID函数可使用,而不像MySQL提供uuid()函数,不过在contrib里有,只需要导入一下uuid-ossp.sql即可。(PS:注意权限问题,要Pg可读改文件。)
导入很简单,下面是win下面测试,其他平台类似该操作:
D:/>psql -U postgres -h localhost -f D:/PostgreSQL/8.4/share/contrib/uuid-ossp.sql
Password for user postgres:
SET
CREATE FUNCTION
CREATE FUNCTION
CREATE FUNCTION
CREATE FUNCTION
CREATE FUNCTION
CREATE FUNCTION
CREATE FUNCTION
CREATE FUNCTION
CREATE FUNCTION
CREATE FUNCTION
进入psql,执行:
postgres=# select uuid_generate_v1();
uuid_generate_v1
--------------------------------------
86811bd4-22a5-11df-b00e-ebd863f5f8a7
(1 row)
postgres=# select uuid_generate_v4();
uuid_generate_v4
--------------------------------------
5edbfcbb-1df8-48fa-853f-7917e4e346db
(1 row)
主要就是uuid_generate_v1和uuid_generate_v4,当然还有uuid_generate_v3和uuid_generate_v5。其他使用可以参见PostgreSQL官方文档 uuid-ossp。
- PostgreSQL UUID 函数
- postgresql 创建 uuid 自定义函数
- Postgresql: UUID的使用
- Postgresql: UUID的使用
- Postgresql: UUID的使用
- postgresql uuid-ossp安装
- postgresql扩展uuid
- postgreSQL生成UUID(GUID)
- Postgresql uuid,pgtrashcan,pldebugger install
- 关于Postgresql uuid-ossp的问题
- postgresql 函数
- postgreSQL函数
- PostgreSQL-函数
- postgresql函数
- Postgresql 函数
- MySQL UUID函数详解
- mysql中uuid函数
- 建立UUID函数
- 新型的存储系统 Cassandra
- xmpp和jabber的区别
- 为eclipse配置spket插件
- 用photoshop怎么把字清除
- C#(ASP.NET) 下载数据 C#实现通过程序自动抓取远程Web网页信息
- PostgreSQL UUID 函数
- useradd使用问题
- 急求欧凯KTV点歌系统注册机
- 使用Delphi保护级类成员
- SOCKET模型
- sudo使用问题之——xxx is not in the sudoers file。
- 常用的网页切换特效代码
- GCC的升级
- 踏入linux编程的第一步