我的问题很简单。我知道UUID的概念,并希望生成一个UUID来指代我的数据库中店铺中的每个“项目”。听起来很合理吧?
问题是以下这行代码会返回错误:
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.
我已阅读页面:http://www.postgresql.org/docs/current/static/uuid-ossp.html
我的操作系统是Ubuntu 10.04 x64,正在运行Postgres 8.4。
select dbo.uuid_generate_v4()
。 - Richardgen_random_uuid()
函数即可。来源:https://dev59.com/a2cs5IYBdhLWcg3w433H#61970869 - Jahan Zinedine