I am developing an application in which I decided to use the UUID for primary and foreign keys. For this purpose, I used the extension "uuid-ossp", which works fine in the dev environment.
Now I am installing a testing environment. The database is configured using a script created by the client. The structure is standard: admin user, application user, application namespace, etc.
I can create an extension with an administrator account:
$ psql mydb -U [admin_user]
mydb=
CREATE EXTENSION
mydb=
uuid_generate_v4
--------------------------------------
23e45b57-a658-41a5-8661-0cc06568eff8
But when I connect to the user of the database application, I can not create uuid:
$ psql mydb -U [app_user]
SELECT uuid_generate_v4();
mydb=> select uuid_generate_v4();
ERROR: function uuid_generate_v4() does not exist
Both admin_user and app_user are in the same database. App_user can “see” the extension, but not use it:
bdd3001=> select * from pg_catalog.pg_extension;
extname | [...]
-----------+-
plpgsql | [...]
uuid-ossp | [...]
Any ideas?