SELECT gen_random_uuid()
产生输出
ERROR: function gen_random_uuid() does not exist
SQL state: 42883
Hint: No function matches the given name and argument types. You might need to add explicit type casts.
Run Code Online (Sandbox Code Playgroud)
我CREATE EXTENSION pgcrypto;在选定的数据库上运行并SELECT gen_random_bytes(1)完美运行(gen_random_bytes不适用于pgcrypto未手动创建扩展的其他数据库)。
% psql --version
psql (PostgreSQL) 9.5.3
Run Code Online (Sandbox Code Playgroud)
Ubuntu 版本是 16.04。