Postgresql: UUID的使用

默认安装的 Postgresql 是不带 UUID 函数的,为了生成一个 UUID,我们必须装载它到数据库中。

CREATE EXTENSION "uuid-ossp";

然后就可以使用uuid_generate_v4()函数了.

select uuid_generate_v4();

转自:

http://stackoverflow.com/questions/20810921/cant-use-uuid-and-create-an-extension-to-use-it

http://stackoverflow.com/questions/12505158/generating-a-uuid-in-postgres-for-insert-statement

http://blog.csdn.net/yapingxin/article/details/6365055

http://www.postgresql.org/docs/9.4/static/contrib.html

posted @ 2015-10-09 10:00  —八戒—  阅读(468)  评论(0编辑  收藏  举报