Skip to content
Advertisement

Unable to grant all privileges to new user on Postgres

I’m creating a new user in a Postgres database (AWS RDS) and trying to grant all privileges on all tables in public schema of an existing database to that user. It is failing with below error. I even tried after logging in as the rds_superuser (postgres) and got the same error.

psql (13.3, server 10.15)

ERROR: permission denied for relation table1

Can someone help me out here?

EDIT: Found a workaround but not sure if this is the best approach. Logged in as the postgres user, ran the below query and then logged back in as the new_user and was able to run select queries on the tables.

EDIT2: Please find the output below.

Advertisement

Answer

You have to issue the GRANT statements as user test_user.

Only the owner can grant privileges on an object (or a user who has been granted the privilege WITH GRANT OPTION).

User contributions licensed under: CC BY-SA
9 People found this is helpful
Advertisement