HiveBrain v1.2.0
Get Started
← Back to all entries
debugsqlMinor

Even after permissions are updated, I still get the error permission denied for relation users

Submitted by: @import:stackexchange-dba··
0
Viewed 0 times
afterpermissionstheerrorstillarepermissiondeniedgetfor

Problem

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.

Solution

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;

Code Snippets

GRANT ALL ON SCHEMA my_schema TO my_user;
GRANT USAGE ON SCHEMA my_schema TO my_user;

Context

StackExchange Database Administrators Q#56028, answer score: 8

Revisions (0)

No revisions yet.