The answer for ERROR: permission denied for language c is not working for me:
$ psql -U postgres -d postgres
psql (15.4 (Debian 15.4-1.pgdg120+1))
postgres=> CREATE DATABASE books;
CREATE DATABASE
postgres=> \c books
You are now connected to database "books" as user "postgres".
postgres=> CREATE EXTENSION IF NOT EXISTS "uuid-ossp";
ERROR: permission denied for language c
postgres=> UPDATE pg_language SET lanpltrusted = true WHERE lanname LIKE 'c';
ERROR: permission denied for table pg_language
This CREATE EXTENSION IF NOT EXISTS "uuid-ossp" is the first thing that I need to do, else I’ll get errors like:
ERROR: function uuid_generate_v4() does not exist
However, it is blocked by permission denied for language c. How can I make it work please?
>Solution :
You need to be a superuser to create C language functions.
And you should never, ever update catalog tables. Fortunately, since you were not a superuser, you were kept from shooting yourself in the foot.
If you yourself don’t have superuser access (and I hope you don’t, given what you were trying to do here), you’ll have to ask your DBA to run these statements for you.
Finally, you don’t need that extension to generate random UUIDs. Recent versions of PostgreSQL have gen_random_uuid().