如何在Ubuntu 10.04上使用PostgreSQL 8.4.4生成uuid?

Spr*_*dzy 5 postgresql ubuntu uuid ubuntu-10.04

我正在使用Ubuntu 10.04运行PostgreSQL 8.4.4.

我试图生成uuid但无法找到办法.

我确实有uuid-ossp.sql /usr/share/postgresql/8.4/contrib/uuid-ossp.sql

当我尝试这是我得到的:

postgres=# SELECT uuid_generate_v1();
ERROR:  function uuid_generate_v1() does not exist
LINE 1: SELECT uuid_generate_v1();
               ^
HINT:  No function matches the given name and argument types. You might need to add explicit type casts.
Run Code Online (Sandbox Code Playgroud)

任何的想法 ?

Pau*_*lin 12

内容contrib不会自动运行.您必须自己运行它才能安装这些功能.我不知道8.4版本,但在8.3版本中它似乎只为每个数据库安装它,所以打开你在psql中使用的数据库并发出命令\i /usr/share/postgresql/8.4/contrib/uuid-ossp.sql