I installed PostgreSql and checked if extention ‘uuid-ossp’ was there.
CREATE EXTENSION IF NOT EXISTS "uuid-ossp";
And I checked the results with sql query.
SELECT * FROM pg_available_extensions;
However, the uuid_generate_v4() function cannot be used when creating a table.
CREATE TABLE my_table
(
uuid UUID NOT NULL UNIQUE DEFAULT uuid_generate_v4()
);
Error message is below
SQL Error [42883]: ERROR: function uuid_generate_v4() does not exist
Hint: No function matches the given name and argument types. You might need to add explicit type casts.
I’m looking for a solution to this problem. and I confirmed that superuser is executable. How can I enable the user I created to run it?
2
Answers
After making the user a superuser and reconnecting, the uuid_generate_v4() function can be used.
Is there any way to use it without making it a superuser?
Maybe schema is not proper. Did you try to: