7

I'm getting the error ERROR: permission denied for relation users and have tried to update privileges using both

grant all privileges on all tables in schema ops to my_user GRANT ALL PRIVILEGES ON TABLE the_table TO my_user

In the Grants tab of DBVisualizer I can see that the my_user user has the privileges DELETE, INSERT, SELECT, TRUNCATE, and UPDATE. IS_GRANTABLE is set to NO for all of these. Yet I still get this error. What is there left to do.

Erwin Brandstetter
  • 185,527
  • 28
  • 463
  • 633
1252748
  • 173
  • 1
  • 1
  • 4

1 Answers1

8

In addition to privileges on the TABLE, a role needs privileges for the SCHEMA and the DATABASE. The most likely candidate is the schema. If so, this additional GRANT would be the fix:

GRANT ALL ON SCHEMA my_schema TO my_user;

Or at least:

GRANT USAGE ON SCHEMA my_schema TO my_user;
Erwin Brandstetter
  • 185,527
  • 28
  • 463
  • 633