ERROR: permission denied for table ‘table_name’ in PostgreSQL

In this article, we will see solution for “ERROR: permission denied for table ‘table_name’ in PostgreSQL”

ERROR permission denied for table table_name in PostgreSQL

Reason: User doent have permissions to access that particular table or relation or view.

Solution: We have to grant all privileges for the problematic user. Also, run as super user or user who is having grantable privileges.

1. Connect with user who is superuser or user with grantable privileges.
2. Connect to the database in which table exists.
3. Then, run the following command to grant all privileges to user david on table ‘students’.

GRANT ALL PRIVILEGES ON TABLE students TO david;

So in this article, we have seen solution for ERROR: permission denied for table ‘table_name’ in PostgreSQL.