相关疑难解决方法(0)

在Postgres中为Insert语句生成UUID?

我的问题很简单.我知道UUID的概念,我想生成一个从我的DB中的'store'引用每个'item'.看似合理吧?

问题是以下行返回错误:

honeydb=# insert into items values(
uuid_generate_v4(), 54.321, 31, 'desc 1', 31.94);
ERROR:  function uuid_generate_v4() does not exist
LINE 2: uuid_generate_v4(), 54.321, 31, 'desc 1', 31.94);
        ^
HINT:  No function matches the given name and argument types. You might need to add explicit type casts.
Run Code Online (Sandbox Code Playgroud)

我已经阅读了以下网页:http://www.postgresql.org/docs/current/static/uuid-ossp.html

在此输入图像描述

我在Ubuntu 10.04 x64上运行Postgres 8.4.

postgresql uuid postgresql-8.4

318
推荐指数
9
解决办法
29万
查看次数

标签 统计

postgresql ×1

postgresql-8.4 ×1

uuid ×1