How make a default value for uuid rows?, the uuid_generate_v4()
function works only if the uuid-ossp
extension is enabled but can not enable.
postgres=# CREATE EXTENSION IF NOT EXISTS "uuid-ossp";
CREATE EXTENSION
postgres=# SELECT uuid_generate_v4();
uuid_generate_v4
--------------------------------------
929d5e41-d7a8-408a-b0e9-feecf10d853d
(1 row)
...
demo=> select uuid_generate_v4();
ERROR: function uuid_generate_v4() does not exist
LINE 1: select uuid_generate_v4();
^
HINT: No function matches the given name and argument types. You might need to add explicit type casts.
demo=> CREATE EXTENSION IF NOT EXISTS "uuid-ossp";
ERROR: permission denied to create extension "uuid-ossp"
HINT: Must be superuser to create this extension.