Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Privileges not being updated

Tags:

postgresql

After running

db=> GRANT ALL PRIVILEGES ON ALL TABLES IN SCHEMA public TO userx;
WARNING:  no privileges were granted for "pg_stat_statements"
GRANT

I tried to

drop trigger t_table on tablex;

I got this result

[42501] ERROR: must be owner of relation tablex

This is everything I ran to change my privileges:

GRANT CONNECT ON DATABASE dbx to userx;
GRANT USAGE ON SCHEMA public to userx;
GRANT ALL PRIVILEGES ON ALL SEQUENCES IN SCHEMA public TO userx;
GRANT ALL PRIVILEGES ON ALL TABLES IN SCHEMA public TO userx;
ALTER DEFAULT PRIVILEGES IN SCHEMA public GRANT ALL PRIVILEGES ON TABLES TO userx;
ALTER DEFAULT PRIVILEGES IN SCHEMA public GRANT ALL PRIVILEGES ON SEQUENCES TO userx;
ALTER DEFAULT PRIVILEGES IN SCHEMA public GRANT ALL PRIVILEGES ON FUNCTIONS TO userx;

What could I be possibly be missing? could WARNING: no privileges were granted for "pg_stat_statements" mean something or is it stopping at that table and not adding the privileges?

like image 640
Bernardo Avatar asked Oct 17 '25 15:10

Bernardo


1 Answers

Like the error message says, only the table owner (and a superuser) can do that.

The TRIGGER privilege allows you to create a trigger on the table, but not to drop one.

Ownership is not a privilege you can grant; you have to use ALTER TABLE ... OWNER TO ... for that.

like image 157
Laurenz Albe Avatar answered Oct 20 '25 07:10

Laurenz Albe